在研究进程performance问题时,碰到process working set的疑惑。结论是process working set是指进程空间中当前存在于物理内存(RAM)中的那部分。当出现page faul,而内存又充足时,会在RAM中分配物理内存页给当前进程。windows的memory mgt负责这块。如果内存充足,process working set不会trim。
但是,如果process working set值不断增大,可能有内存泄露。当然,个人认为,判断memory leak的最可靠标识,还是监控virtual memory size。
《Microsoft Windows Internals》第四版里面的有小节讲的很清楚:
cited from <Microsoft WIndows Internal, Fourth Edition>:
Working Set Management
Every process starts with a default working set minimum of 50 pages and a working set maximum of 345 pages. Although it has little effect, you can change the process working set limits with the Windows SetProcessWorkingSetSize function, though you must have the "increase scheduling priority" user right to do this. However, unless you have configured the process to use hard working set limits (new in Windows Server 2003), these limits are ignored, in that the memory manager will permit a process to grow beyond its maximum if it is paging heavily and there is ample memory (and conversely, the memory manage