LRU Cache
Visualize the Least Recently Used (LRU) cache eviction policy.
Free theory articleVisualize the Least Recently Used (LRU) cache eviction policy.
Concept & interpretation
A Least Recently Used (LRU) cache is a data structure designed to manage memory efficiently by keeping recently accessed items while discarding the ones that haven't been used for the longest time. When the cache reaches its maximum capacity and a new item needs to be added, the LRU policy evicts the item that was accessed the furthest in the past. This makes it highly effective for scenarios where data accessed recently is likely to be accessed again in the near future (temporal locality).