GATE - 2007 | OS | A process has been allocated 3 page frames. Assume that none of the

GATE - 2007 | OS | A process has been allocated 3 page frames. Assume that none of the
Posted on 16-02-2022

GATE - 2007 [Operating System]

Question:

A process has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal page replacement policy is used, how many page faults occur for the above reference string?  

A

7

B

8

C

9

D

10

     

Solution:

Option (A) is Correct

Given sequence is


1, 2, 1, 3, 7, 4, 5, 6, 3, 1


No. of frames = 3


Using Optimal page replacement,


A process has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal page replacement policy is used, how many page faults occur for the above reference string?


Total 7 page faults.

Thank You