Thursday, December 13, 2007

assignment #3

pg. 104question # 4
What is the cause of thrashing? Cause of ThrashingThrashing results in several performance problems. Consider the following scenario, which is based on actual behavior of early paging systems.The operating system monitors CPU utilization. If the CPU utilization is too low, we increase the degree of multiprogramming by introducing new process to the system. A global page-replacement algorithm is used; it replaces pages without regard to the process which they belong. Now suppose that a process enters a new phase in its execution and needs more frames. Its starts faulting and taking frames away from other processes. These processes need those pages, however, and so they also fault, taking frames away from other processes. These faulting processes must use the paging device to swap pages in and out. As they queue up for the paging device, the ready queue empties. As the processes wait for the paging device, CPU utilization decreases.The CPU scheduler sees the decreasing CPU utilization and increases the degree of multiprogramming as a result. The new process tries to get started by taking frames from running processes, causing more page faults and a longer queue for the paging device. As a result CPU utilization drops even further, and CPU scheduler tries to increase the degree of multiprogramming even more. Thrashing has occurred, and system throughput plunges. The page fault rate increases tremendously. As a result, the effective memory-access time increases. No work is being done. How does the operating system detect thrashing? It doesn't. An operating system would have no idea that thrashing is happening. The OS would be responsible for making use of virtual memory to make up for the lack of physical RAM during a particular computing session, but would have no concept that this is causing issues with hardware.
Once thrashing is detected, what can the operating system do to eliminate it?
Thrashing is usually a symptom of low memory in your system. To minimize it, try adding more memory to your computer or try to cut down on use interface elements that use extra memory like complicated background images and detailed icons.

No comments: