Operating systems notes
Page Replacement Algorithms
When memory is full and a fault arrives, which page do you throw out, and how much does getting it wrong cost you? Every section is a drawn page beside a clear written explanation, about 19 minutes in all.
- Chapter 24 of 37
- About 19 minutes
- 9 sections
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

In this chapter
- The eviction question, and how we measure the answer
- OPT, the optimal policy you can never build
- FIFO, evict the oldest, and pay for it
- Belady’s anomaly, more memory, more faults
- LRU, bet that the recent past predicts the near future
- Approximating LRU with a single reference bit
- The Clock algorithm, second-chance as a spinning hand
- The knobs around eviction: allocation, dirty pages, prefetch
- Reality: what real kernels do, and why you already know this
Next chapters
Read the whole chapter
Sign in and the chapter opens with every drawn page, and all 38 operating systems chapters beside it.
DSA comes with the all labs plan and every ChaiCode batch.