AlgoViz

Cache eviction policies

easy 22 min

A cache has a memory limit.

Chapter mnemonic

Three cache eviction policies

First through the door. Longest since a visit. Fewest visits.

Maya arrived first, Leo last visited longest ago, and Jo visited least. Who leaves under each policy?

FIFO evicts Maya, LRU evicts Leo, and LFU evicts Jo.