Sie sind auf Seite 1von 1

Page Replacement Algorithms

1. RAND (Random)
choose any page to replace at random
assumes the next page to be referenced is random
can test other algorithms against random page replacement
2. MIN (minimum) or OPT (optimal) :
Belady's optimal algorithm for the minimum number of page faults
replace the page that will be referenced furthest in the future or not at all
problem: we cannot implement it, because we cannot predict the future
this is the best case
can use it to compare other algorithms against
3. FIFO (First In, First Out):
select the page that has been in main memory the longest
use a queue (data structure)
problem: although a page has been present for a long time, it may be really useful
Windows NT and Windows 2000 use this algorithm, as a local page replacement algorithm
(described separately), with the pool method (described in more detail separately)
create a pool of the pages that have been marked for removal
manage the pool in the same way as the rest of the pages
if a new page is needed, take a page from the pool
if a page in the pool is referenced again before being replaced in memory, it is
simply reactivated
this is relatively efficient
4. LRU (Least Recently Used):
choose the page that was last referenced the longest time ago
assumes recent behavior is a good predictor of the near future
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
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
5. NRU (Not Recently Used):
as an approximation to LRU, select one of the pages that has not been used recently (as
opposed to identifying exactly which one has not been used for the longest amount of time)
keep one bit called the "used bit" or "reference bit", where 1 => used recently and 0 => not
used recently
variants of this scheme are used in many operating systems, including UNIX and
MacIntosh
most variations use a scan pointer and go through the page frames one by one, in some
order, looking for a page that has not been used recently.

Das könnte Ihnen auch gefallen