I know the algorithms of MRU and its reversed one Least Recently Used (LRU).
I think LRU is reasonable, as LRU element means it will be used at least possible in future. However, MRU element means the element is very possible to be used in future, why evict it? What is the reasonable scenario?
LRU (or Least Recently Used) is a cache eviction strategy, wherein if the cache size has reached the maximum allocated capacity, the least recently accessed objects in the cache will be evicted.
Most Recently Used (MRU): This cache algorithm removes the most recently used items first. A MRU algorithm is good in situations in which the older an item is, the more likely it is to be accessed.
There are a lot of eviction policies: - FIFO (First In First Out), LIFO (Last In First Out) — I think it doesn't need to be explained. - LRU (Least Recently Used) — discards items that have not been used for a long time (more than other elements in the cache).
Cache replacement algorithms are used to optimize the time taken by processor to process the information by storing the information needed by processor at that time and possibly in future so that if processor needs that information, it can be provided immediately.
Imagine you were looking up the details of buses as they arrived at a bus stop, based on their bus number (or whatever identifier you use).
It's somewhat reasonable to think that if you've just seen a number 36 bus, you're less likely to see another one imminently than to see one of the other buses that stops there.
Just one example, but the idea is more general: in some cases, having "just seen something" is a good indicator that you're unlikely to see the same thing again soon.
Perhaps a more tangible example would be a media server. When the user has completed watching a video (let's say it's an episode of a TV show), they are presumably the least likely to want to view it again. So if you must evict something, evict the most recently viewed item.
In practice though, I believe this type of cache is typically used in addition to an LRU or LFU cache, where the two caches in tandem allow you to cover a wide variety of cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With