Load Control

Load Control

Even with the best page replacement algorithm and optimal global allocation of page frames to processes, it can come about that the system thrashes. Actually, whenever the combined working sets of all processes exceed the capacity of memory, thrashing can be expected. One symptom of this situation is that the PFF algorithm indicates that some processes need more memory but no processes need less memory. In this case there is no way to give more memory to those processes needing it without hurting some other processes. The only real solution is to temporarily get rid of some processes.

A good technique to reduce the number of processes competing for memory is to swap some of them to the disk and free up all the pages they are holding. For instance, one process can be swapped to disk and its page frames divided up among other processes that are thrashing. If the thrashing stops, the system can run for a while this way. If it does not stop, another process has to be swapped out, and so on, until the thrashing stops. Therefore even with paging, swapping is still required, only now swapping is used to reduce potential demand for memory, rather than to reclaim pages.

Swapping processes out to relieve the load on memory is reminiscent of two-level scheduling, in which some processes are put on disk and a short-term scheduler is used to schedule the remaining processes. Clearly, the two ideas can be combined, with just enough processes swapped out to make the page-fault rate acceptable. From time to time, some processes are brought in from disk and other ones are swapped out.

On the other hand, another factor to examine is the degree of multiprogramming. When the number of processes in main memory is too low, the CPU may be idle for significant periods of time. This consideration argues for considering not only process size and paging rate when deciding which process to swap out, but also its characteristics, such as whether it is CPU bound or I/O bound, and what characteristics the remaining processes have.


algorithm, page frames, memory, swapping, multiprogramming