Thrashing
Thrashing occurs when a process spends more time doing page replacement than actual execution. It happens when the degree of multi-programming is too high, leading to a sharp drop in CPU utilization, because the CPU keeps waiting for pages to be brought from secondary memory.
Causes of Thrashing:
When the degree of multi-programming is too high, to the point where memory frames are insufficient for the processes.
When processes frequently require pages that are not currently in memory, causing a large number of page faults.
Excessive paging causes the CPU to spend more time handling page faults than executing instructions.
When a new process takes away memory frames from a running process, causing that process to fault frequently.
Minimizing Thrashing:
Local Replacement: When a process needs a new page, it replaces one from its own allocated pages instead of interfering with pages of other processes.
Working Set Strategy: Ensures that a process gets enough frames to hold its active working set of pages, reducing page faults and improving CPU utilization.