in Operating System recategorized by
2,756 views
3 votes
3 votes

Determine the number of page faults when references to pages occur in the order $1,2,4,5,2,1,2,4.$ Assume that the main memory can accommodate $3$ pages and the main memory already has the pages $1$ and $2,$ with page $1$ brought earlier than page $2.$ (assume LRU i.e., Least-Recently-Used algorithm is applied)

  1. $3$
  2. $4$
  3. $5$
  4. None of the above
in Operating System recategorized by
by
2.8k views

4 Comments

sorry bro my bad...option B is correct
0
0
Why the answer is D? I think it should be B as it is given that 1,2 are already present in the main memory.
3
3
ans should be 4.

page fault at 4,5,1,4
0
0

@MRINMOY_HALDER I am getting same 

0
0

3 Answers

4 votes
4 votes
Option B. 4 page faults will happen.

1(hit), 2(hit), 4(miss), 5(miss), 2(hit), 1(miss), 2(hit), 4(miss).
2 votes
2 votes
Answer is (B) 4
2 votes
2 votes

The main memory already has the pages $1$ and $2$, with page $1$ brought earlier than page $2.$ It means $1,2$  is ${\color{Magenta}{\textbf{not}}}$ a page fault.

$1,2,4,5,2,1,2,4.$

Using LRU(Least -  Recently -  Used) algorithm we got $4$ page faults.

So, the correct answer is $(B).$

2 Comments

Nice.

how you made this figure?

I mean Latex or paintbrush?
0
0
Microsoft paint.
0
0
Answer:

Related questions