User programs of varying sizes are loaded into memory when the user requests that a program be executed. These requests used to come in the form of a deck of punched cards, but now they come from a user's terminal. In Fig. 11.2.1, four user programs labeled A, B, C and D co-exist in memory. Suppose C finishes early and a new job E is started. E will need to be placed in memory somewhere, so it will probably try to fit within C's space if it is big enough. If not, D may be moved down towards B, a process called memory compaction, which causes holes (regions of unused memory) to coalesce into larger holes so that a new job may be started. In the very worst scenario, E may need almost all of memory so it may have to wait until A, B and D are done. These memory hogs will be kept waiting till 3:00 AM on Christmas day!
|