Skip to content

Commit

Permalink
Merge pull request #280 from wunameya/patch-1
Browse files Browse the repository at this point in the history
Update cache_lru.md 修正错别字
  • Loading branch information
xiaolincoder authored Nov 27, 2024
2 parents ed2ed57 + f482590 commit 2ddd0bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion os/3_memory/cache_lru.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ select * from t_user where name like "%xiaolin%";

### 怎么避免缓存污染造成的影响?

前面的 LRU 算法只要数据被访问一次,就将数据加入活跃 LRU 链表(或者 young 区域),**这种 LRU 算法进入活跃 LRU 链表的门槛太低了**正式因为门槛太低,才导致在发生缓存污染的时候,很容就将原本在活跃 LRU 链表里的热点数据淘汰了。
前面的 LRU 算法只要数据被访问一次,就将数据加入活跃 LRU 链表(或者 young 区域),**这种 LRU 算法进入活跃 LRU 链表的门槛太低了**正是因为门槛太低,才导致在发生缓存污染的时候,很容就将原本在活跃 LRU 链表里的热点数据淘汰了。

所以,**只要我们提高进入到活跃 LRU 链表(或者 young 区域)的门槛,就能有效地保证活跃 LRU 链表(或者 young 区域)里的热点数据不会被轻易替换掉**

Expand Down

0 comments on commit 2ddd0bd

Please sign in to comment.