Skip to main content

GATE CSE 2025Operating System › Memory Management & Virtual MemoryVerified

GATE CSE 2025 PYQ: ​Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6…

​Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2 . The contents of the frames are as follows initially and after each reference (from left to right):
initiallyafter−1∗2∗3∗4∗5∗416∗451∗3∗2∗−1111111666662−−224444444111−−−33555555533 \begin{array}{|c|lllllllllllll|} \hline \text{initially} & \text{after} \\ \hline -&1^* &2^* & 3^* & 4^* & 5^* & 4 & 1 & 6^* & 4 & 5 & 1^* & 3^* & 2^* \\ \hline -&1 & 1 & 1 & 1 & 1 & 1 & 1 & 6 & 6 & 6 & 6 & 6 & 2 \\ \hline -&- & 2 & 2 & 4 & 4 & 4 & 4 & 4 & 4 & 4 & 1 & 1 & 1 \\ \hline -&- & - & 3 & 3 & 5 & 5 & 5 & 5 & 5 & 5 & 5 & 3 & 3 \\\hline \end{array}
The *-marked references cause page replacements.

Which one or more of the following could be the page replacement policy/policies in use?

  1. A
    Least Recently Used page replacement policy
  2. B
    Least Frequently Used page replacement policy
  3. C
    Most Frequently Used page replacement policy
  4. D
    Optimal page replacement policy
    Correct answer

Answer

(D) Optimal page replacement policy

Approach

Simulate each candidate replacement policy on the given reference string with three frames and compare the victim choices with the table. A policy is possible only if it can produce every replacement shown.

Only the Optimal page replacement policy can produce the given replacement sequence; LRU, LFU, and MFU each fail at one or more references.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.