Chapter 9 · SimulationPage Replacement? ← Chapter 9 FIFO OPT LRU LFU Clock Frames 3 Compare Reference Classic Belady Locality Random Speed 1.5/s ✗ Faults 0 ✓ Hits 0 Hit rate – Step 0/0 ClosePage ReplacementA process accesses pages in the order of the reference string. If the page is already in a frame, this is a hit; otherwise a page fault occurs and the page is loaded into memory. When all frames are full, the replacement algorithm picks the victim page to evict. The grid shows the frames after each reference; the strip below shows the algorithm state (which page is next to be evicted).UsageChoose an algorithm and a number of frames (1–8).Type a reference string (up to 40 pages separated by spaces) or pick a preset.Play, step through, or click a reference in the top row of the grid to jump to that step.Compare shows the page faults of all algorithms and FIFO’s fault counts for 1–6 frames (Belady’s anomaly).AlgorithmsFIFOThe page loaded first is evicted.OPTThe page used furthest in the future is evicted (requires knowing the future; a lower bound on faults).LRUThe least recently used page is evicted.LFUThe page with the lowest count is evicted; ties go to the least recently used. The count resets when a page is evicted.ClockIf R=1, the bit is cleared and the page is skipped (second chance). The first page with R=0 is evicted. A newly loaded page gets R=1.Legend ✓ hit ↓ loaded (fault) next to be evicted ↑7 evictedBadges#1Position in the FIFO queue (1 = oldest)−2LRU: last used 2 steps ago×3LFU: reference count+4OPT: next used in 4 steps (∞: never)R1Reference bit in the clock algorithmKeys←→ stepSpace playHomeEnd first / lastEsc close