Compare the LRU and FIFO page replacement algorithms, and what is Belady's Anomaly?

Last updated 5 July 2026

  • FIFO evicts the oldest page using a cheap queue, but may evict heavily used pages just because they are old.

  • LRU evicts the page unused longest, exploiting locality for fewer faults. Pure LRU is costly, so real systems approximate it (clock/second-chance with reference bits).

  • Belady's Anomaly: giving FIFO more frames can increase faults. LRU is immune because it is a stack algorithm (N-frame resident set is a subset of the N+1 set).

  • https://www.reddit.com/r/cscareeradvice/new/
  • https://www.reddit.com/r/macbook/comments/1jg7fl6/24gb_ram_enough_for_software_engineering/
  • https://www.reddit.com/r/infosys/comments/1t71add/anyone_received_round_2_mails/
  • https://www.reddit.com/r/cscareeradvice/best/
  • https://www.reddit.com/r/LeetcodeChallenge/
  • https://www.reddit.com/r/infosys/comments/1t71i55/infosys_specialist_programmer_april_26_1st_round/
  • https://www.reddit.com/r/programming/comments/1hqo19u/static_search_trees_40x_faster_than_binary_search/
All Operating Systems interview questions