Assume that there are 3 page frames which are initially empty. If the page reference string is the number of page faults using the optimal replacement policy is__________.
GATE CSE 2014Operating System › Memory Management & Virtual MemoryVerified
GATE CSE 2014 PYQ: Assume that there are 3 3 3 page frames which are initially empty. If the page reference string is 1, 2, 3,…
Answer
7
Approach
Simulate the Optimal (MIN) page replacement algorithm on the given reference string with 3 initially empty frames. On every miss, if a free frame exists fill it; otherwise evict the resident page whose next use is farthest in the future (a page never used again counts as infinitely far). Count every reference that is not already resident as a page fault.
Optimal replacement evicts the page with the farthest next use. Simulating gives faults at references 1, 2, 3, 4, 5, 3, 6, i.e. 7 page faults in total. All three community answers agree on 7.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.