Operating Systems · Chapter 9

Page Replacement Simulator

Enter a reference string, choose the number of frames, and compare how replacement policies react to hits and page faults.

Results

Page faults
Page hits
Fault rate
Hit rate

Algorithm Comparison

Algorithm Guide

FIFO: removes the page that entered memory earliest.

Optimal: removes the page whose next use is farthest in the future. It is a theoretical benchmark because real systems do not know future references.

LRU: removes the page that has not been used for the longest time.

LFU: removes the page with the lowest reference count; ties are broken by oldest recent use.

Second Chance / Clock: approximates LRU using a reference bit and a circular pointer.

Try the Belady anomaly scenario with FIFO and compare 3 vs 4 frames. FIFO can sometimes produce more faults when given more memory.