Saturday, June 29, 2013

. Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults would occur for the Optimal Page replacement? Remember all frames are Initially empty, so your first unique pages will all cost one fault each.



For Optimal Page replacement algorithm:
:: for 3 page frames
Request
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
Page frame
1*
1
1
1
1
1*
1
1
1
1*
1
3*
3
3
3*
3
3
3
3*
3

2*
2
2
2*
2
2
2
2*
2
2*
2
7*
7
7
2*
2
2*
2
2


3*
4*
4
4
5*
6*
6
6
6
6
6
6*
6
6
1*
1
1
6*
Page fault
No
No
No
no
no
No
No
No
no

:: for 5 page frames
Request
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
Page frame
1*
1
1
1
1
1*
1
1
1
1*
1
1
1
1
1
1
1*
1
1
1

2*
2
2
2*
2
2
2
2*
2
2*
2
2
2
2
2*
2
2*
2
2


3*
3
3
3
3
3
3
3
3
3*
3
3
3*
3
3
3
3
3



4*
4
4
4
6*
6
6
6
6
6
6*
6
6
6
6
6
6






5*
5
5
5
5
5
7*
7
7
7
7
7
7
7
Page fault
No
No
No
no
no
no
no
no
no
no
no
no
No

:: for 7 page frames
Request
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
Page frame
1*
1
1
1
1
1*
1
1
1
1*
1
1
1
1
1
1
1*
1
1
1

2*
2
2
2*
2
2
2
2*
2
2*
2
2
2
2
2*
2
2*
2
2


3*
3
3
3
3
3
3
3
3
3*
3
3
3*
3
3
3
3*
3



4*
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4






5*
5
5
5
5
5
5
5
5
5
5
5
5
5







6*
6
6
6
6
6
6*
6
6
6
6
6
6*












7*
7
7
7
7
7
7
7
Page fault
No
No
no
No
no
no
No
no
no
no
no
no
No

Page Frame
Page fault
3
11
5
7
7
7

No comments:

Post a Comment