- Two general approaches to memory management can be used, depending (in part) on the available hardware
- The simplest strategy, called swapping, consists of bringing in each process in its entirety, running it for a while, then putting it back on the disk
- The other strategy, called virtual memory, allows programs to run even they are only partially in main memory
- The basic idea of swapping is to treat main memory as a preemptable resource
- A high-speed swapping device is used as the backing storage of the preempted processes
- Fragmentation refers to the unused memory that the memory management system cannot allocate
- Internal fragmentation; Waste of memory within a partition, caused by the difference between the size of a partition and the process loaded. Severe in static partitioning schemes (Multiprogramming with Fixed Partitions (MFT)).
- External fragmentation; Waste of memory between partitions, caused by scattered noncontiguous free space. Severe in dynamic partitioning schemes (Multiprogramming with Variable Partitions (MVT), swapping).
- Compaction (aka relocation) is a technique that is used to overcome external fragmentation
- The responsibilities of a swapper include:
- Selection of processes to swap out criteria: suspended/blocked state, low priority, time spent in memory
- Selection of processes to swap in criteria: time spent on swapping device, priority
- Allocation and management of swap space on a swapping device. Swap space can be:
- system wide
- dedicated (e.g., swap partition or disk)
2004-04-18