Next: Address Space and Virtual
Up: No Title
Previous: Storage Compaction
- In previous schemes, user programs remain in memory until completion
- Now - another twist - swap job out of main storage (to secondary storage) if it
requires service from some external routine (so another process can use the CPU)
- A job may typically be need to swapping in and out many time before completion
- Early systems - Only one job occupies the main storage at one time
- Now, main store large enough to have many user programs active at the same time
(swapping in and out of main memory)
- Other variations of swapping exist, will come to these later
- Allocate a bit more than necessary for process to grow during
execution
- How do we keep track of memory in implementation : use of linked lists,
buddy system (dividing memory according to a power of 2) - leads to big wastes
(checkerboading or external fragmentation) or bitmaps (use a structure, where a
0 indicates if block is free, and 1 otherwise
U
When process in memory, no disk space allocated to it
However, when a need for swapping occurs, suitable disk space must be found
Area on disk where this happens : swap space (usually the /tmp area in unix)
Sometimes, swap space automatically allocated on process creation (hence, a fixed
swap space per process)
An average process in the middle of memory (after system has reached equilibrium)
will encounter half allocations and half deallocations (above and below)
The Fifty percent rule = if mean number of processes in memory is n,
the mean number of holes is n/2
Thats because adjacent holes are merged, adjacent processes are not (hence a process / hole
asymmetry) - just a heuristic
Numerous others, used for optimising swapping performance
Omer F Rana
Tue Feb 11 19:21:10 GMT 1997