CS FundamentalsHardGATE CS

With 3 frames, initially empty, the reference string 4, 7, 0, 7, 1, 0, 1, 2, 1, 2, 7, 1, 2, 0, 4, 7 is run under FIFO, LRU and Optimal. How many page faults does each give?

  1. A. FIFO 9, LRU 8, OPT 7
  2. B. FIFO 8, LRU 8, OPT 7
  3. C. FIFO 8, LRU 9, OPT 6
  4. D. FIFO 8, LRU 9, OPT 7

Correct answer: D. FIFO 8, LRU 9, OPT 7

Simulating gives FIFO 8, LRU 9 and OPT 7. LRU is not always better than FIFO: here it evicts 7 just before 7 is reused and later evicts 1 and 2 before they return, while OPT is always the minimum.

More Operating Systems questions

Exams that ask this topic