The GATE Grind

GATE 2012 CS (CS1) – Question 52

Operating System · Memory Management and Virtual Memory · 2 marks · Multiple choice

With three initially empty frames, reference string is 1,2,3,2,4,1,3,2,4,1. Let LRU,FIFO,OPTIMAL be fault counts. Which relation holds?

  1. OPTIMAL < LRU < FIFO
  2. OPTIMAL < FIFO < LRU
  3. OPTIMAL = LRU
  4. OPTIMAL = FIFO

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) OPTIMAL < FIFO < LRU

Explanation

Simulating the reference string gives optimal faults at positions 1,2,3,5,8 (five total), FIFO faults at 1,2,3,5,6,8 (six), and LRU faults at every position except the repeated two at position four (nine). Thus OPTIMAL<FIFO<LRU, option B. FIFO replacement follows arrival order rather than most recent use.

More Memory Management and Virtual Memory questions

All Memory Management and Virtual Memory questions →