Windows NT Working Set Management

A process is a running instance of an executable file. A working set, by the definition from Denning's 1968 paper, is the set of memory pages currently in use by a process.

Here is a problem: how to define "currently" and how long is "currently". Such as we define 10 minutes as "currently". Then the working set can be computed by examining how many pages have been used since 10 minutes ago.

However, the i386 (IA-32) processors implement a concept of page marking. If a page is accessed, its accessed bit is marked, but without any time information. Thus, we need to clear the accessed bit first and then see when it is set to actually determine when it is accessed. This also requires the OS to memorize past accesses together with times in another place. This is more complex to implement. However it is correct.

I don't know how NT exactly handles this. But by reading the book Windows Internal 4th Edition, it seems that this may be done in this way: when memory is intense, the memory manager pages out those pages with a zero accessed bit, and then clears all accessed bits. Next time memory is intense, it repeats this.

I think if it is really like this, then it is not the concept of working set mentioned in Denning's paper. I'm not sure. However after I have used my emptywss.bat tool as a scheduled task that runs every 20 minutes, in the cmdtools package maintained by me, the overall performance seemed better.

Return to Windows 9x/NT Overview