Explain Belady's Anomaly. Why does it occur in FIFO page replacement but not in LRU?
Last updated
Belady's Anomaly: for some reference strings, adding page frames increases page faults under FIFO (e.g. 1,2,3,4,1,2,5,1,2,3,4,5 faults more with 4 frames than 3).
FIFO evicts by arrival order, so the pages held with N+1 frames are not guaranteed to include those held with N frames.
LRU (and OPT) are stack algorithms: the resident set with N frames is always a subset of that with N+1, so more frames never hurts.