Page Replacement Algorithm
Page Replacement Algorithm
FIFO
1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5
No of frames
=3
1* 4 4 4* 5 5 5*
2 2* 1 1 1* 3 3
3 3 3* 2 2 2* 4
No of page fault=9
No of frames=3
7* 2 2 2* 4 4 4* 0 0 0* 7 7 7
0 0* 3 3 3* 2 2 2* 1 1 1* 0 0
1 1 1* 0 0 0* 3 3 3* 2 2 2* 1
No of page =15
= page that was not used for long time used for replacement
7 2 2 4 4 4 0 1 1 1
0 0 0 0 0 3 3 3 0 0
1 1 3 3 2 2 2 2 2 7
No of page fault=12
1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5
1 4 4 4 5 3 3 3
2 2 1 1 1 1 4 4
3 3 3 2 2 2 2 5
=10
Optimal page replacement= page that will not be used for long time
7 2 2 2 2 2 7
0 0 0 4 0 0 0
1 1 3 3 3 1 1
No of pagefault=9
1 1 6 6 6 2 4
2 2 2 2 1 1 1
3 5 5 3 3 3 3
=9