← 🧮 Networks

🗂 Page Replacement

Tick: 0 / 0
Current page:
FIFO faults: 0
LRU faults: 0
Clock faults: 0
Optimal faults: 0
FPS:
FIFO — evicts oldest-loaded page
LRU — evicts least recently used
Clock — approximates LRU with a ref-bit sweep
Optimal — evicts page used farthest in future
Drag — rotate · Scroll — zoom

🗂 Page Replacement Policies: FIFO, LRU, Clock and Optimal

A shared stream of memory-page requests is fed simultaneously into four rows of memory frames, one per replacement policy, so you can watch FIFO, LRU, clock and optimal make different eviction calls on the exact same sequence.

🔬 What It Demonstrates

Each row runs the identical request sequence but keeps its own eviction logic. A box flashes orange on a page fault and green on a hit, and each row's bar grows with its running fault count — making the gap between a cheap heuristic and the optimal bound visible at a glance.

🎮 How to Use

Set the frame count and feed speed, and pick a request pattern — including a Belady worst-case sequence that can make FIFO get worse with more frames. Generate a new sequence any time and compare fault totals across policies.

💡 Did You Know?

The optimal policy (Belady's MIN) is provably fault-minimal but needs to know the future — it's unimplementable in a real OS and exists purely as the yardstick every practical algorithm is measured against.