• edited by
10,459 views
28 28 votes

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$

Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?

  1. $0$
  2. $1$
  3. $2$
  4. $3$

5 Answers

Best answer
27 27 votes

Using $LRU = 9$ Page Fault

Using Optimal$ = 7$ Page Fault

So, LRU-OPTIMAL $=2$

Option (C).

• edited by
12 12 votes
Optimal replacement policy

1     1      1     1     1

2      7      4     5     6

3      3      3     3     3

 For Pages 1 2 3 6 4 5  6, page faults occur

LRU replacement policy

9 page faults occur page fault occurs for pages 1 2 3 7 4 5 6 3 1

So 2 more page faults than optimal algorithm

So the answer is $(C)$
• edited by
3 3 votes

Solution to the above problem.

Tip: In question asking no. of page fault always calculate no. of  page hit as its count will be less so keeping a track on its count will be easy.

No. of Page fault =Total length of reference string - No. of Page Hit

Answer:
Position:
Show:

Related questions

52 52 votes
4 answers 4 answers
26.2k
26.2k views
Kathleen asked Sep 21, 2014
26,225 views
A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements:P: I...
25 25 votes
6 answers 6 answers
14.6k
14.6k views
Kathleen asked Sep 21, 2014
14,561 views
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...
90 90 votes
14 answers 14 answers
48.1k
48.1k views
Kathleen asked Sep 21, 2014
48,065 views
Two processes, $P1$ and $P2$, need to access a critical section of code. Consider the following synchronization construct used by the processes:/* P1 */ while (true) { wa...
37 37 votes
4 answers 4 answers
17.8k
17.8k views
Kathleen asked Sep 21, 2014
17,839 views
A single processor system has three resource types $X, Y$ and $Z$, which are shared by three processes. There are $5$ units of each resource type. Consider the following ...