HomeAlgorithms & AILRU Cache: Evicting the Least Recently Used Item

🗂️ LRU Cache: Evicting the Least Recently Used Item

Explore how a fixed-capacity cache decides what to throw away when it's full, using the Least Recently Used eviction policy built from a hash map and a doubly linked list.

Algorithms & AI3DModerate60 FPS
lru-cache-eviction-lab ↗ Open standalone

This simulator demonstrates how a fixed-capacity LRU cache processes a sequence of accesses, showing hits, misses, and which item gets evicted each time the cache is full.

🔬 What It Demonstrates

This simulator demonstrates how a fixed-capacity LRU cache processes a sequence of accesses, showing hits, misses, and which item gets evicted each time the cache is full.

🎮 How to Use

Set the cache capacity, then feed in a sequence of keys one at a time to watch the recency order update and see evictions happen live.

💡 Did You Know?

Real CPU caches rarely implement exact LRU because tracking true recency for many cache lines is expensive in hardware, so they use cheaper approximations that behave similarly.

⚙ Under the hood

Explore how a fixed-capacity cache decides what to throw away when it's full, using the Least Recently Used eviction policy built from a hash map and a doubly linked list.

lrucacheeviction-policydata-structureshash-maplinked-listalgorithmssystem-design

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)