Practice mode Operating Systems

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.