AlgoPlus//structures / page-replacement
Read the theory

Page Replacement

When memory is full, the policy picks which page to evict — fewer faults is better.

Policy
LRU
Faults
0
Fault rate
Policy
Reference string (page numbers)
Legend
Hit
Fault
Loaded / evicted
AI Tutor Workspace
In a nutshell
When every frame is full and a new page is needed, a replacement policy decides which page to evict. FIFO drops the oldest-loaded page, LRU drops the one unused for longest, and Optimal drops the one needed farthest in the future — the unbeatable benchmark, since it can see ahead. Fewer page faults is the goal; FIFO can even get worse when given more frames (Belady's anomaly).
Ready
Press play to begin the cinematic walkthrough.
With more pages than frames, something must be evicted on a fault. Optimal (evict what's needed farthest ahead) is the unbeatable benchmark; LRU approximates it with the recent past; Clock approximates LRU with a single 'second-chance' bit per frame.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Page Replacement.