Nepedia
Back to Discover
Fluent Reader
💻

Working set

technology Maturity 9-11 Next article →

A computer does many jobs at once. Each job is called a process. Every process needs memory to do its work. This memory is divided into small pieces called pages. The working set is the group of pages a process uses during a specific time.

Knowing the working set helps the computer manage its resources. It helps the computer decide which pages should stay in the fast main memory, also called RAM. If the computer keeps the right pages in RAM, the process can make good progress. This makes the whole computer run much more smoothly.

Working with memory is a delicate balance. If a computer keeps too many pages for one process, it leaves no room for others. This means fewer jobs can be ready to run. However, if a process has too few pages in RAM, it will have many page faults. A page fault happens when the computer must look for a page in slow storage. If too many page faults happen, the computer might start to "thrash."

Thrashing is when a computer spends more time moving pages than doing actual work. To prevent this, the computer uses an all or nothing model. If a process needs more pages than the RAM can hold, the computer swaps that process out to storage. This frees up space so other processes can finish their tasks quickly.

This idea was first defined by Peter Denning in 1968. He described the working set as the collection of information a process uses during a certain time interval.

His model helps the computer optimize how much work the CPU can do. By managing the working set, the computer can keep many processes running at once. This is called multiprogramming. Even if a process is temporarily removed from memory, it often finishes much sooner this way. This is better than running only one job at a time or trying to run too many at once.

Computers use a moving window to track these pages. This is called the working set window. As new pages are used, they enter one end of the window. The oldest pages drop off the other end.

To save time, computers often just track the time of the last use. This helps them know which pages were used within a certain period. There are also different types of working sets. A process has a code working set for its instructions. It also has a data working set for its information. If these do not fit in the right memory levels, thrashing can happen again.

You can think of a working set like a set of tools. Imagine you are building a model. You keep the tools you use every minute on your desk. These are your working set. If your desk is too small, you must put some tools away in a box.

If you try to keep every tool you own on the desk, you will have no room to work. The working set idea works for other things too. For example, copying a file needs two file handles. One is for reading and one is for writing. If a computer only has one handle, it must work much harder to finish the job.

535 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.