Why is LRU better than FIFO?

后端 未结 5 1362
我在风中等你
我在风中等你 2021-01-06 13:04

Why is Least Recently Used better than FIFO in relation to page files?

5条回答
  •  抹茶落季
    2021-01-06 13:14

    Treat the RAM as a cache. In order to be an effective cache, it needs to keep the items most likely to be requested in memory.

    LRU keeps the things that were most recently used in memory. FIFO keeps the things that were most recently added. LRU is, in general, more efficient, because there are generally memory items that are added once and never used again, and there are items that are added and used frequently. LRU is much more likely to keep the frequently-used items in memory.

提交回复
热议问题