Help understanding Windows memory - “Working Set”

I've been tracking down a few memory leaks in my application. It's been a real pain, but I've finally tightened everything up. However, there's one bit of Windows memory management that is confusing me. Here is a printout of the app's memory usage over time...

Time        PrivateMemorySize64        WorkingSet64
20:00:36    47480,                     50144
20:01:06    47480,                     50144
20:01:36    47480,                     50144
20:02:06    47480,                     149540
20:02:36    47480,                     149540
20:03:06    47480,                     149540

The working set jumped from 49 MB to 146 over a span of 30 seconds. This happened overnight as the application was basically doing nothing.

The working set (which is what task manager shows me) seems to be able to be influenced by other applications such as debuggers (as I learned while looking for memory leaks). After reading the documentation on what Working Set is, I still don't have a good understanding.

Any help is appreciated.

Update: Thanks to some links from responders as well as some additional searching, I have a better understanding on how a separate process can cause my process' working set to grow. Good to know that a spike in the working set is not necessarily an indication that your app is leaking... Further reason to not rely on Task Manager for memory evaluation :)

Helpful links:

A few words on memory usage or: working set vs. private working set

CyberNotes: Windows Memory Usage Explained

9
задан BabaBooey 23 March 2011 в 15:10
поделиться