Machine-translated by Google. Questions are authored in English.
Top

Discussion

The Least Recently Used (LRU) page replacement algorithm evicts

  • A.the page that has not been used for the longest time
  • B.the page that was loaded first
  • C.the page that will be needed furthest in the future
  • D.a page chosen at random

Answer: D

Correct answer: the page that has not been used for the longest time

LRU evicts the page whose most recent use lies furthest in the past, on the reasoning that a page unused for a long time is unlikely to be needed soon - the principle of temporal locality. It approximates the theoretical optimal algorithm, the third option, which evicts the page that will next be needed furthest in the future. That is unimplementable, since it requires knowledge of the future, but it is used as a benchmark against which real algorithms are measured. FIFO, the second option, evicts the oldest-loaded page and is simple but poor, and it suffers Belady’s anomaly: adding more frames can increase the number of page faults, which is deeply counter-intuitive. LRU belongs to the class of stack algorithms and cannot exhibit it. True LRU is expensive to implement, needing a timestamp or a stack updated on every reference, so real systems approximate it with reference bits - the clock or second-chance algorithm being the usual method.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.