Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Operating Systems
  • Virtual memory
  • Medium

With 3 page frames, initially empty, how many page faults does LRU replacement cause for the reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2?

Memory Management

Pick an option to check your answer.

Simulate LRU, evicting the page used least recently.

  1. 7, 0, 1: three faults fill the frames.
  2. 2 evicts 7 (fault 4); 0 is a hit; 3 evicts 1 (fault 5); 0 is a hit.
  3. 4 evicts 2 (fault 6); 2 evicts 3 (fault 7); 3 evicts 0 (fault 8); 0 evicts 4 (fault 9).
  4. 3 and 2 are hits.

Total: 9 page faults.

Why not the others

  • 1010 is the count under FIFO replacement for this string.
  • 77 is the count under the optimal (OPT) policy, the lower bound for any algorithm.
  • 1313 counts every reference as a fault, ignoring the hits.

Report an error

GATE CS · Operating Systems · Memory Management