GATE / CS ARCHIVE

GATE CSE 2014 SET 2 / QUESTION 33

GATE CSE 2014 Set 2 Q33

Operating Systems · Virtual Memory & Paging · Full GATE CSE 2014 Set 2 paper

GATE 2014 Set 2, Q33 2 marks · MCQ
Report issue

Virtual Memory & Paging

Question 33, GATE 2014: Twenty physical frames initially contain pages 101 through 120. A program references pages 1,2,…,100 in order and repeats that access sequence THRICE. Which replacement policy has the same fault count as optimal replacement? A LRU; B FIFO; C LIFO; D MRU. Retain the source's occupied-frame condition and its wording about repetitions.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: Official D needs initially reclaimable frames; literal initial occupancy makes no listed policy optimal

1. Set up the reasoning. Analyze the initially occupied frames before using the familiar result that MRU works well on repeated scans. After MRU loads page 1, that new page becomes the most recently used frame and is the next victim.

2. Derive the result. MRU is often optimal for cyclic scans larger than memory when frames initially fill with the scan’s pages. Here all 20 frames already contain irrelevant 101–120. Literal MRU evicts one old page for 1, then evicts the newly referenced 1 for 2, and so on, retaining 19 irrelevant pages forever. Every requested page therefore faults. LIFO likewise keeps 19 irrelevant pages; LRU/FIFO also fault on every pass because the cycle exceeds 20 frames. OPT discards the never-used initial pages and retains useful pages for later passes: for three total passes an explicit farthest-future simulation gives 260 faults instead of 300. Even simply preserving 19 useful pages across passes beats all-fault behavior. Official D requires treating the initial frames as free/reclaimable before MRU, a missing convention.

3. Check the interpretation. The official D cannot simply be explained by an initially empty-cache simulation. Literal occupied-frame MRU leaves nineteen irrelevant pages resident, unlike OPT. The inherited discrepancy remains open; the phrase about repetitions also needs a clearly stated pass-count convention when numerical simulations are quoted.

Original paper, page 38 · Answer key