written 6.7 years ago by | • modified 2.9 years ago |
Subject: Operating System
Topic: MEMORY MANAGEMENT
Difficulty: Hard
written 6.7 years ago by | • modified 2.9 years ago |
Subject: Operating System
Topic: MEMORY MANAGEMENT
Difficulty: Hard
written 6.7 years ago by |
Thrashing is term referred to a high paging activity. A process is thrashing if it is spending more of its time paging than actually executing.
Consider a process that currently needs some more frames. Currently all the frames are occupied. So it will have to swap with certain pages; however since all the pages are actively being used, there would be need for an immediate page replacement after this. Such a scenario is called thrashing.It results in serious performance problems.
A process that is spending more time paging than executing is said to be thrashing. In other words it means, that the process doesn't have enough frames to hold all the pages for its execution, so it is swapping pages in and out very frequently to keep executing. Sometimes, the pages which will be required in the near future have to be swapped out.
Initially when the CPU utilization is low, the process scheduling mechanism, to increase the level of multi programming loads multiple processes into the memory at the same time, allocating a limited amount of frames to each process.
As the memory fills up, process starts to spend a lot of time for the required pages to be swapped in, again leading to low CPU utilization because most of the processes are waiting for pages. Hence the scheduler loads more processes to increase CPU utilization, as this continues at a point of time the complete system comes to a stop.
To prevent thrashing we must provide processes with as many frames as they really need "right now"