Determine the number of page faults when references to pages occur in the following order : 1, 2, 4, 5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main memory already has the pages 1 and 2, with page one having brought earlier than page 2. (LRU page replacement algorithm is used) 

Determine the number of page faults when references to pages occur in the following order : 1, 2, 4, 5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main memory already has the pages 1 and 2, with page one having brought earlier than page 2. (LRU page replacement algorithm is used)  Correct Answer 4

Page reference: 1, 2, 4, 5, 2, 1, 2, 4

Page replacement algorithm: Least Recently Used (LRU)

page references

Initial

1

2

4

5

2

1

2

4

Frames

1

1

1

1 5 5 5 5 4
2

 2

2

2

2 2 2 2 2
 

 

 

 4

4 4 1 1 1

Page status

  H H M

M

H

M

H

M

 

LRU = 4 miss = 4-page faults

Related Questions