LRU PAGE REPLACEMENT


  • choose the page that has not been used for the longest period of time.
  • associates with each page the time of that page's last use.
  • When a page must be replaced ,LRU chooses that page that has not been used for the longest period of time.
  • problem: requires updating on every page referenced
  • too slow to be used in practice for managing the page table, but many systems use approximations to LRU
  • Two implementations are feasible to implement LRU replacement

       1.counters.

  • associate with each page table entry a time-of -use field and add to the counter.
  • the counter is incremented for every memory reference.
  • replace the page with the smallest time value

       2.stack.

  • can manage LRU with a list called the LRU stack or the paging stack (data structure)
  •  in the LRU stack, the first entry describes the page referenced least recently, the last entry describes to the last page referenced.
  • if a page is referenced, move it to the end of the list

No comments:

Post a Comment