0% found this document useful (0 votes)
17 views

Page Replacement Algorithm

The document discusses different page replacement algorithms: FIFO, LRU, and optimal page replacement. It provides examples of how each algorithm works on sample page reference strings and calculates the number of page faults for each.

Uploaded by

Lokesh Anandan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Page Replacement Algorithm

The document discusses different page replacement algorithms: FIFO, LRU, and optimal page replacement. It provides examples of how each algorithm works on sample page reference strings and calculates the number of page faults for each.

Uploaded by

Lokesh Anandan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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

Belady’s Anomaly ==no of frames increases , no of pagefault


increases
LRU page replacement

= 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

You might also like