Recently, I have been looking at memory usage. Up until this point, I have been using working set to tell me how much physical memory a process is using. It turns out that this definition is wrong. Working set actually tells you how many virtual pages in the process are mapped into physical memory. What is the difference? With private memory (memory that can’t be shared between two processes, or two virtual addresses in the same process; example: memory return from malloc), these two definitions are equivalent. But my original (bad) definition breaks down for shared memory, or memory mapped files. Try this as an example:
The result you will find is that the working set from #5 is double the working set from #4. However, the OS isn’t using any more physical memory in #5 then in #4.