- The hardware only provides the basic capabilities for virtual memory. The operating system, on the other hand, must make several decisions:
- Allocation-how much real memory to allocate to each (ready) program?
- In general, the allocation policy deals with conflicting requirements:
- The fewer the frames allocated for a program, the higher the page fault rate
- The fewer the frames allocated for a program, the more programs can reside in memory; thus, decreasing the need of swapping.
- Allocating additional frames to a program beyond a certain number results in little or only moderate gain in performance.
- The number of allocated pages (also known as resident set size) can be fixed or can be variable during the execution of a program.
- Fetching-when to bring the pages into main memory?
- Demand paging; Start a program with no pages loaded; wait until it references a page; then load the page (this is the most common approach used in paging systems.)
- Request paging; Similar to overlays, let the user identify which pages are needed (not practical, leads to over estimation and also user may not know what to ask for.)
- Pre-paging; Start with one or a few pages preloaded. As pages are referenced, bring in other (not yet referenced) pages too.
- Opposite to fetching, the cleaning policy deals with determining when a modified (dirty) page should be written back to the paging device.
- Placement-where in the memory the fetched page should be loaded?
- This policy usually follows the rules about paging and segmentation.
- Given the matching sizes of a page and a frame, placement with paging is straightforward.
- Segmentation requires more careful placement, especially when not combined with paging. Placement in pure segmentation is an important issue and must consider free memory management policies.
- With the recent developments in non-uniform memory access (NUMA) distributed memory multiprocessor systems, placement does become a major concern.
- Replacement (see the Fig. 4.13) -what page should be removed from main memory?
- The most studied area of the memory management is the replacement policy or victim selection to satisfy a page fault.
2004-05-25