TLTLBeast
← Back to timeline

Replacement Policies Under Workloads

Hit rate vs cache size — no-locality, 80-20, looping sequential, and clock. OPT wins; LRU tanks on loops.

operating-systemsvirtual-memorypage-replacementcachingclock
Handwritten charts comparing OPT, LRU, FIFO, RAND, and Clock under different workloads
Day scribble — hit rate charts across workloads + clock

Workloads

WorkloadMeaning
No-localityEach reference is a random page in the accessed set
80-2080% of refs → 20% hot pages; 20% of refs → 80% cold
Looping sequentialTouch X pages in order, loop for Y accesses

No-locality

OPT climbs toward 100% hit rate. LRU / FIFO / RAND sit together much lower — without locality, the practical policies look the same and lose to OPT.

80-20

Locality helps. Ranking top → bottom:

  1. OPT
  2. LRU (close behind)
  3. FIFO / RAND (clustered below)

Looping sequential

The weird one:

  • OPT — steady diagonal climb
  • RAND — below OPT, still climbing
  • LRU / FIFO — stuck near 0% until the cache can hold the whole loop, then jump to ~100%

They keep evicting the page you're about to need next.

80-20 + Clock

Clock: a hand walks circularly over pages (approximate LRU, cheaper).

Ranking: OPT > LRU > Clock > RND / FIFO.

Summary

Small tweaks to policies buy different tradeoffs — pick by workload, not vibes.

Get in Touch

Questions, feedback, or just want to talk systems? Send a message and it'll land in my inbox.

If I send you a message back, it might end up in your spam folder — just please check that.