It seems to be often said that Task Manager does not provide an accurate indication of how much memory is in use by a process.
If this is indeed the case, what's the easiest way to find these things out?
I'd like to know:
- Total Memory in use (whether in RAM or paged or whatever)
- Total RAM in use (running in a situation where the machine has loads of free physical RAM so things getting forcibly paged out hopefully isn't an issue)
- Total Memory actually used by the program (not counting the extra overhead the GC keeps around)
- Total Memory usage that is solely used by my program (not counting shared libraries/shared memory)
- Total Shared memory usage.
Process Explorer will show you some of this if you double-click on on a process.
Start Performance Monitor (perfmon.exe) and take a look at the .Net CLR Memory performance object. Every running .net program has its own instance. You should be able to find what you want there.
There are some good features in the SysInternals ProcessExplorer including a .NET profiler, though ANTS is the way to go if you need a pro tool.
http://memprofiler.com/ is a very good .Net memory profiler. But Microsoft's build into Windows Performance Monitor (perfmon) will also give you those figures. See http://dotnetdebug.net/2005/06/30/perfmon-your-debugging-buddy/ for that.
I use memprofiler as well and it helped us out tremendously.
There are some things you can do but I believe the best thing out there, if you're serious about profiling your application, is to use the Ants Profiler by Red Gate:
http://www.red-gate.com/Products/ants_profiler/index.htm
This software is really comprehensive and will give a good picture what sorts of memory usage and other sorts of metrics your app presents.