A system has three page frames and uses LRU page replacement. For the reference string 1, 2, 3, 1, 4, 2, how many page faults occur?

Options

  • A. 4
  • B. 5
  • C. 6
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. 5

Detailed Explanation

Explanation: The references 1, 2 and 3 initially cause three faults. Reference 1 is a hit. When 4 is referenced, LRU replaces page 2 because it is the least recently used. Reference 2 then causes another fault and replaces the least recently used page. Therefore, total page faults = 5.