FIFO evicts the oldest page (simple, can evict a heavily used page, and suffers Belady's anomaly). Optimal (Belady's algorithm) evicts the page that will not be used for the longest time (the lowest possible faults, but needs knowledge of the future, so it is used as a benchmark). LRU evicts the least recently used page (a good approximation of Optimal based on locality; exact LRU needs hardware support or counters or a stack). Clock (second chance) approximates LRU with a reference bit and a circular pointer.
Reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 with 3 frames: FIFO gives 15 page faults, LRU gives 12, and Optimal gives 9.
Dirty pages need to be written back on eviction, so replacement policies often prefer clean pages.
Loading…