In my last post about memory leaks, I emphasized the importance of calling Dispose. This time I’m going to talk about how you can see how much memory your application is using.
You probably think that I think you’re stupid… Right? Right now you say to your self
Of course I know where to find my app’s memory usage! I’m not f$£@&g stupid!
Ok. I get it. You of course go to the task manager and look at the memory usage column for you app. Right? Wrong. Don’t do that. It dos not tell you anything about your app’s memory usage. Why? First here’s an example to make a point (or rub it in…):

.Net application just started.
Here I have started my test application and as you see it has a memory usage of 11 696K.
The funny thing is that if you minimize the application it only has a memory usage of 812 K.

.Net application minimized.
What happened? Did all my objects just disappear when I minimized my app. I don’t think so! The problem is that Mem Usage equals working set (http://support.microsoft.com/kb/293215). And what dos working set tell you? One of the more common definitions of working set is;
The working set of a process is defined as the number of virtual memory pages that it is allowed to keep resident in RAM.
In other words; it dos not tell you how much memory your app are using.
Now we know that Mem Usage is not much use to us, what CAN we use? What you want is your applications private memory. Private memory is the actual space in memory your application use. And as it happens, you can find that column in Task Manager as well… Only it’s called Virtual Memory. Go figure. In Task Manager go to View -> Select Columns…, and select Virtual Memory.
So my advice to you is to get rid of the Mem Usage column and replace it with Virtual Memory. Do this on all the computers at your office and tell everyone!