Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Working set

Working set

Overview
Peter Denning
Peter J. Denning
Peter J. Denning is an American computer scientist, and prolific writer. He is best known for inventing the working-set model for program behavior, which defeated thrashing in operating systems and became the reference standard for all memory management policies...

 (1968) defines “the working set of information of a process
Process (computing)
In computing, a process is an instance of a computer program, consisting of one or more threads, that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently....

 at time to be the collection of information referenced by the process during the process time interval ”. Typically the units of information in question are considered to be memory pages
Page (computing)
In a context of computer virtual memory, a page, memory page, or virtual page is a fixed-length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing...

. This is suggested to be an approximation of the set of pages that the process will access in the future (say during the next time units), and more specifically is suggested to be an indication of what pages ought to be kept in main memory to allow most progress to be made in the execution of that process.

The effect of choice of what pages to be kept in main memory (as distinct from being paged out to auxiliary storage) is important: if too many pages of a process are kept in main memory, then fewer other processes can be ready at any one time.
Discussion
Ask a question about 'Working set'
Start a new discussion about 'Working set'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
Peter Denning
Peter J. Denning
Peter J. Denning is an American computer scientist, and prolific writer. He is best known for inventing the working-set model for program behavior, which defeated thrashing in operating systems and became the reference standard for all memory management policies...

 (1968) defines “the working set of information of a process
Process (computing)
In computing, a process is an instance of a computer program, consisting of one or more threads, that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently....

 at time to be the collection of information referenced by the process during the process time interval ”. Typically the units of information in question are considered to be memory pages
Page (computing)
In a context of computer virtual memory, a page, memory page, or virtual page is a fixed-length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing...

. This is suggested to be an approximation of the set of pages that the process will access in the future (say during the next time units), and more specifically is suggested to be an indication of what pages ought to be kept in main memory to allow most progress to be made in the execution of that process.

The effect of choice of what pages to be kept in main memory (as distinct from being paged out to auxiliary storage) is important: if too many pages of a process are kept in main memory, then fewer other processes can be ready at any one time. If too few pages of a process are kept in main memory, then the page fault
Page fault
In computer storage technology, a page is a fixed-length block of memory that is used as a unit of transfer between physical memory and external storage like a disk, and a page fault is an interrupt to the software raised by the hardware, when a program accesses a page that is mapped in address...

 frequency is greatly increased and the number of active (non-suspended) processes currently executing in the system is set to zero.

The working set model states that a process can be in RAM
Random-access memory
Random-access memory is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order...

 if and only if all of the pages that it is currently using (often approximated by the most recently used pages) can be in RAM. The model is an all or nothing model, meaning if the pages it needs to use increases, and there is no room in RAM, the process is kicked from memory to free the memory for other processes to use.

Often a heavily loaded
Load (computing)
In UNIX computing, the system load is a measure of the amount of work that a computer system performs. The load average represents the average system load over a period of time...

 computer has so many processes queued up that, if all the processes were allowed to run for one scheduling
Scheduling (computing)
Scheduling is a key concept in computer multitasking and multiprocessing operating system design, and in real-time operating system design. In modern operating systems, there are typically many more processes running than there are CPUs available to run them.Scheduling refers to the way processes...

 time slice, they would refer to more pages than there is RAM, causing the computer to thrash
Thrash (computer science)
In computer science, thrash is the term used to describe a degenerate situation on a computer where increasing resources are used to do a decreasing amount of work. In this situation the system is said to be thrashing...

.

By kicking some processes from memory, the result is that processes -- even processes that were temporarily kicked from memory -- finish much sooner than they would if the computer attempted to run them all at once.
The processes also finish much sooner than they would if the computer only ran one process at a time to completion, since it allows other processes to run and make progress during times that one process is waiting on the hard drive or some other peripheral.

In other words, the working set strategy prevents thrashing
Thrash (computer science)
In computer science, thrash is the term used to describe a degenerate situation on a computer where increasing resources are used to do a decreasing amount of work. In this situation the system is said to be thrashing...

 while keeping the degree of multiprogramming as high as possible. Thus it optimizes CPU utilization and throughput.

The main hurdle in implementing the working set model is keeping track of the working set. The working set window is a moving window. At each memory reference a new reference appears at one end and the oldest reference drops off the other end. A page is in the working set if it is referenced in the working set window.

To avoid the overhead of keeping a list of the last k referenced pages, the working set is often implemented by keeping track of the time t of the last reference, and considering the working set to be all pages referenced within a certain period of time.

The working set isn't a page replacement algorithm
Page replacement algorithm
In a computer operating system that uses paging for virtual memory memory management, page replacement algorithms decide which memory pages to page out when a page of memory needs to be allocated...

, but page-replacement algorithms can be designed to only remove pages that aren't in the working set for a particular process. One example is a modified version of the clock algorithm called WSClock.