Skip to main content
Definition Website Computer and Technology

Thrashing

Subject: Computer and Technology noun /ˈθræʃ.ɪŋ/ 1 definition

  1. Definition (noun)

    Entry #208 · Updated

    Thrashing is a pathological performance failure in which a computer system spends nearly all of its resources repeatedly transferring data between fast and slow storage tiers—or reallocating contested resources—rather than making forward computational progress. It occurs when the active working set of running processes exceeds the capacity of a constrained resource such as physical memory, a processor cache, or a thread pool, triggering a self-reinforcing cycle of page faults, cache misses, or scheduling overhead. Unlike normal high utilization where throughput plateaus near peak capacity, thrashing crosses a tipping point where rising demand causes effective throughput to collapse toward zero.

    Common Forms

    • Page Thrashing: Occurs when the combined working sets of active processes exceed available physical RAM, forcing the memory manager to continuously swap pages to and from secondary storage while processors stall waiting on I/O.

    • Cache Thrashing: Happens when competing memory accesses repeatedly map to the same cache sets or exceed total cache capacity—in CPU caches, translation lookaside buffers, or distributed caches—causing entries to be evicted right before reuse.

    • Garbage Collection Thrashing: Arises in managed runtimes when live object retention stays near the heap ceiling, forcing the collector to execute frequent reclamation cycles that free negligible space.

    • Thread Thrashing: Develops when excessive runnable threads contend for limited processor cores, causing the scheduler to spend more time context-switching and invalidating core-local caches than executing application code.

    Example

    A database server with 16 GB of RAM handles a sudden traffic spike that expands its active working set to 24 GB across concurrent query workers, triggering continuous page faults against an NVMe swap partition. Within seconds, disk queues saturate at 100% utilization, processor time shifts predominantly to kernel I/O wait, and query latency jumps from 8 milliseconds to over 30 seconds until connection limits shed the excess load.