Chapter 7 Virtual Memory p2
Chapter 7 Virtual Memory p2
Demand
Prepaging
Paging
Demand Paging
Demand Paging
only brings pages into main memory when a reference is made
to a location on the page
many page faults when process is first started
principle of locality suggests that as more and more pages are
brought in, most future references will be to pages that have
recently been brought in, and page faults should drop to a
very low level
Prepaging
Prepaging
pages other than the one demanded by a page fault are
brought in
exploits the characteristics of most secondary memory devices
if pages of a process are stored contiguously in secondary
memory (disk) it is more efficient to bring in a number of
pages at one time
ineffective if extra pages are not referenced
should not be confused with “swapping” (all pages are moved
out)
2- Placement Policy
Determines where in real memory a process
piece is to reside
Important design issue in a segmentation system
(best-fit, first-fit, etc.)
Paging or combined paging with segmentation
placing is irrelevant (transparent) because
hardware performs functions with equal
efficiency
3- Replacement Policy
Deals with the selection of a page in main
memory to be replaced when a new page must be
brought in
objective is that the page that is removed be the page
least likely to be referenced in the near future
Difficult to implement
one approach is to tag each page with the time of last
reference
this requires a great deal of overhead
LRU Example
First-in-First-out (FIFO)
Treats page frames allocated to a process as a circular buffer
If all of the frames have a use bit of 1, then the pointer will
make one complete cycle through the buffer, setting all the
use bits to 0, and stop at its original position, replacing the
page in that frame.
Combined Examples
4- Cleaning Policy
Concerned with determining when a modified page should be
written out to secondary memory (disk)
Demand Cleaning
a page is written out to secondary memory only when it has been selected for
replacement
Precleaning
Writes modified pages before their page frames are needed; allows the writing
of pages in batches
5- Load Control
Determines the number of processes
that will be resident in main memory
multiprogramming level