Skip to content
Official PYQ · 2010

GATE CS 2010 Q24 — Memory Management and Virtual Memory

Explain with AI

A system uses FIFO policy for system replacement. It has 44 page frames with no pages loaded to begin with. The system first accesses 100100 distinct pages in some order and then accesses the same 100100 pages but now in the reverse order. How many page faults will occur?

Choose one option
View worked solution

Answer: A

We can analyze the page faults by dividing the process into two phases:

Phase 1: First 100 accesses
Let the 100 distinct pages be accessed in the order P1,P2,…,P100P_1, P_2, \dots, P_{100}. Since all 100 pages are distinct and the 4 frames are initially empty, every access results in a page fault.
Page faults in Phase 1=100\text{Page faults in Phase 1} = 100 At the end of Phase 1, the 4 frames will contain the last 4 accessed pages: {P97,P98,P99,P100}\{P_{97}, P_{98}, P_{99}, P_{100}\}.

Phase 2: Reverse 100 accesses
The pages are now accessed in the reverse order: P100,P99,P98,P97,P96,…,P1P_{100}, P_{99}, P_{98}, P_{97}, P_{96}, \dots, P_1.

  • The first 4 accesses (P100,P99,P98,P97P_{100}, P_{99}, P_{98}, P_{97}) are already present in the frames. Thus, these 4 accesses result in hits (0 page faults).
  • The remaining 96 accesses (P96P_{96} down to P1P_1) are not present in the frames. Since we are moving strictly downwards in index, each of these 96 accesses will result in a page fault.

Page faults in Phase 2=96\text{Page faults in Phase 2} = 96

Total Page Faults:
Total faults=100 (Phase 1)+96 (Phase 2)=196\text{Total faults} = 100 \text{ (Phase 1)} + 96 \text{ (Phase 2)} = 196

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions