- 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.
Answer: C. Solution
Simulate LRU, evicting the page used least recently.
- 7, 0, 1: three faults fill the frames.
- 2 evicts 7 (fault 4); 0 is a hit; 3 evicts 1 (fault 5); 0 is a hit.
- 4 evicts 2 (fault 6); 2 evicts 3 (fault 7); 3 evicts 0 (fault 8); 0 evicts 4 (fault 9).
- 3 and 2 are hits.
Total: 9 page faults.
Why not the others
- is the count under FIFO replacement for this string.
- is the count under the optimal (OPT) policy, the lower bound for any algorithm.
- counts every reference as a fault, ignoring the hits.