Skip to main content

Command Palette

Search for a command to run...

Thrashing

Updated
1 min read

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:

  1. When the degree of multi-programming is too high, to the point where memory frames are insufficient for the processes.

  2. When processes frequently require pages that are not currently in memory, causing a large number of page faults.

  3. Excessive paging causes the CPU to spend more time handling page faults than executing instructions.

  4. When a new process takes away memory frames from a running process, causing that process to fault frequently.

Minimizing Thrashing:

  1. 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.

  2. 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.