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 LRU replacement? Remember all frames are Initially empty, so your first unique pages will all cost one fault each.



For LRU 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
(3)
1*
1
1
4*
4
4
5*
5
5
1*
1
1
3
3
3*
3
3
3
3*
3

2*
2
2
2*
2
2
6*
6
6
6
3*
7*
7
7
2*
2
2*
2
2


3*
3
3
1*
1
1
2*
2
2*
2
2
6*
6
6
1*
1
1
6*
Page fault
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
(5)
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
6*
6
6
6
6
6
6*
6
6
6
6
6
6*



4*
4
4
4
4
4
4
4
3*
3
3
3*
3
3
3
3*
3






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

:: 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
(7)
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
15
5
8
7
7

No comments:

Post a Comment