Why your computer slows to a crawl and how the working set prevents it
In short: Ever wondered why your computer suddenly freezes when you have too many apps open? It is likely thrashing, a state where your system spends more time moving data than actually processing it. The working set model is the clever strategy operating systems use to keep your machine running efficiently.
Introduced by Peter Denning in 1968, the working set is the collection of memory pages a process actively references within a specific time interval. Think of it as the essential toolkit a program needs to make progress. If a system keeps too many pages in main memory, it limits how many processes can run simultaneously. Conversely, if it keeps too few, the process hits a page fault, forcing the system to constantly fetch data from slower auxiliary storage.
When a computer is overloaded, it may attempt to run more processes than its RAM can support. If every process tries to access its working set simultaneously, the system enters a state called thrashing. In this scenario, the computer spends all its time swapping pages in and out of memory, causing performance to plummet. The working set strategy solves this by only allowing a process to run if its entire working set fits in RAM. If there is no room, the system swaps the process out entirely, allowing others to finish their work quickly.
Implementing this requires tracking which pages are currently in use, often using a moving window that updates with every memory reference. Because maintaining a precise list is computationally expensive, systems often approximate this by tracking the time of the last reference. This model extends beyond memory; it applies to parallel programs requiring coscheduling of processes and even to file handles or network sockets. By managing these resources as a collective set, the operating system optimizes CPU utilization and throughput, ensuring that even when resources are tight, the system remains productive rather than paralyzed.
Opens the Intellect+ feed with this card first. Swipe up for the next one.
Sources
- Summary by Intellect · source: Working set
To cite this card, link to https://intellectplus.co.uk/app/technology-working-set.
How we source, check and correct cards: Editorial standards.
General information, not professional advice. Spotted an error? Flag the card or see corrections and complaints.
Intellect Plus is a visual educational discovery platform for exploring fascinating facts and ideas. Brain Food, Not Brain Rot. What is Intellect Plus?
Related
More in Computing and information technology · More in Technology · Latest · A–Z · All topics