Consider the following page reference and reference time strings for a program: Page reference string: 5,4,3,2,1,4,3,5,4,3,2,1,5,.....
Show how pages will be allocated using the FIFO page replacement policy. Also calculate the total number of page faults when allocated page blocks are 3 and 4 respectively.
Page reference string is: 5,4,3,2,1,4,3,5,4,3,2,1,5,.....
For assigned page blocks 3, we contain following FIFO allocation. Page reference marked along with '+' cause page fault and result in page replacement that is performed through replacing the earliest loaded page existing into memory:
|
|
3
|
3
|
3
|
4
|
4
|
4
|
4
|
4
|
2
|
2
|
2
|
|
4
|
4
|
4
|
1
|
1
|
1
|
5
|
5
|
5
|
5
|
5
|
5
|
5
|
5
|
5
|
2
|
2
|
2
|
3
|
3
|
3
|
3
|
3
|
1
|
1
|
5+
|
4+
|
3+
|
2+
|
1+
|
4+
|
3+
|
5+
|
4
|
3
|
2+
|
1+
|
5
|
Page Reference
For assigned page blocks 4, we contain following FIFO allocation. Page reference marked along with '+' cause page fault and result into page replacement.
|
|
|
2
|
2
|
2
|
2
|
2
|
2
|
3
|
3
|
3
|
3
|
|
|
3
|
3
|
3
|
3
|
3
|
3
|
4
|
4
|
4
|
4
|
5
|
|
4
|
4
|
4
|
4
|
4
|
4
|
5
|
5
|
5
|
5
|
1
|
1
|
5
|
5
|
5
|
5
|
1
|
1
|
1
|
1
|
1
|
1
|
2
|
2
|
2
|
5+
|
4+
|
3+
|
2+
|
1+
|
4
|
3
|
5+
|
4+
|
3+
|
2+
|
1+
|
5+
|
Total no. of page faults =10 while allocated page blocks=3
Total no. of page fault =11, while allocated page blocks=4