With 3 initially empty frames, how many page faults does LRU page replacement cause for the reference string 1, 3, 0, 3, 5, 6, 3, 1, 0, 5, 6, 3?
Correct answer D. 10
Explanation
LRU replaces the page unused for the longest time. Only the second and third references to 3 hit, because 3 keeps being reused; the other ten references fault, since each needed page has just been evicted as least recently used. FIFO would give 11 faults on this string and the optimal algorithm 7. LRU approximates the optimal algorithm by using the past to predict the future.
Answer checked How we write and check questions
Discussion