In LRU : it will replace the page which is least recently used
1 2 3 2. 5 6 (r) 3 4(r) 6 3 7(r) 3 1(r) 5r 3 6(r) 3 4r 2r 4 3 5R 1R
|
|
|
|
5 |
5 |
5 |
5 |
5 |
5 |
7 |
7 |
7 |
7 |
7 |
6 |
6 |
6 |
6 |
6 |
6. 6 |
5 |
1 |
|
|
|
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
3. 3 |
3 |
3 |
|
|
2 |
2 |
2 |
2 |
2 |
2 |
4 |
4 |
4 |
4 |
4 |
1 |
1 |
1 |
1 |
1 |
4 |
4 |
4 |
4. 4 |
4 |
4 |
|
1 |
1 |
1 |
1 |
1 |
6 |
6 |
6 |
6 |
6 |
6 |
6 |
6 |
5 |
5 |
5 |
5 |
5 |
2 |
2 |
2. 2 |
2 |
2 |
|
Therefore total replacement at LRU I s 10
optimal page replacement: Replace the page which is not used for longest duration of time in future
no of page fault occur : 7
b option