operating-systems

Definition

Thrashing

Thrashing occurs when a processor spends disproportionate time handling page faults versus executing instructions, causing drastic performance drops.

Mechanism

Feedback Loop

Occurs when sum of resident sets exceeds available RAM. The replacement policy swaps out pages needed almost immediately, creating a cycle: page swapped in → another fault → first page swapped out.

Causes

Insufficient RAM

Physical memory too small for current workload.

Poor Locality

Process accesses memory in scattered patterns unsuitable for paging.

Over-multiprogramming

Too many active processes squeezing resident sets below their working sets.

Prevention

Working Set Management

Monitor pages each process needs and ensure they remain resident.

Process Suspension

Temporarily suspend processes to free frames for remaining active ones.