Intermediate Topic 32 of 51 Operating Systems
Thrashing
Excess paging that cripples performance.
How it works
Thrashing occurs when a system spends more time swapping pages in and out than executing useful work, because the combined working sets of active processes exceed physical memory. Each process faults constantly and evicts pages others need, CPU utilization drops, and a naive scheduler may even start more processes, worsening it. The working-set model and page-fault frequency control address it.
Step-by-step walkthrough
- Too many processes share too little memory.
- Each constantly faults and evicts pages the others need.
- The disk is busy servicing faults.
- CPU utilization collapses as processes wait.
- Reducing the number of running processes or adding RAM restores performance.
Where it is used
Overloaded servers, machines with too many applications or with memory-hungry jobs experience thrashing, seen as high disk activity and an unresponsive system.
Common pitfall
Adding processes or lowering priorities does not fix it; reducing the multiprogramming level, adding RAM, tuning working sets or limiting memory per process does. Local replacement limits damage between processes. Monitoring swap in and out rates and page-fault frequency gives early warning, and containers should have memory limits.
Where it fits in the course
Thrashing is topic 32 of 51 in Operating Systems, rated Intermediate. It follows Page Replacement Algorithms. The next topic is Memory Allocation.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Thrashing?
Where do people use Thrashing?
What is the most common mistake with Thrashing?
What should I learn before this topic?
How can I practice it?
Is Thrashing hard to learn?
How long does it take to learn Thrashing?
Which topics are related to Thrashing?
What should I study after Thrashing?
Related topics
- Page Replacement Algorithms (Operating Systems)
- Memory Allocation (Operating Systems)
- Page Faults (Operating Systems)
- Memory Mapped Files (Operating Systems)