567 views

1 Answer

0 votes
0 votes

As the name suggests, the page which is used LEAST RECENTLY i.e. earliest should be replaced.

So all you need to do is:

1. Check whether the new page that has just came in exist in memory

2. If it already exists no need to do the replacement

3. Otherwise replace it.

Let say the page reference string 7 0 1 2 0 3 0 4 2 3 0 3 2 and we have 4 page slots empty.

Initially all slots are empty, so when 7 0 1 2 are allocated to the empty slots —> 4 Page faults [7 0 1 2]
0 is already their so —> 0 Page fault. [7 0 1 2]
when 3 came it will take the place of 7 because it is least recently used —>1 Page fault [3 0 1 2]
0 is already in memory so —> 0 Page fault[3 0 1 2]
4 will takes place of 1 —> 1 Page Fault [3 0 4 2]
Now for the further page reference string —> 0 Page fault because they are already available in the memory. [3 0 4 2]

Related questions

2 votes
2 votes
0 answers
1
Prajwal Bhat asked Dec 27, 2016
986 views
A.11B.12C.13D.14Couldn't visualize how counter is assigned and how page is exactly replaced based on counter.Visual representation would be helpful rather than just ans!
1 votes
1 votes
1 answer
2
0 votes
0 votes
1 answer
3
1 votes
1 votes
0 answers
4
atul_21 asked Jan 1, 2018
290 views
In Block Replacement techniques, which one leads to poor performance when accesses are made to sequential elements of an Array that is slightly too large to fit into the ...