views:

1046

answers:

7

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.
+1  A: 

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.

BobbyShaftoe
+3  A: 

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.

Lars Truijens
+6  A: 

Grab Process Explorer, right-click -> Properties the process in the list, and then click the ".NET" tab. Select ".NET CLR Memory" from the combobox, and you'll have more live info about your process than you'll know what to do with ;)

moobaa
That info comes from the Performance Counters. You can also view the performance counters with perfmon.
Lars Truijens
True - but I find Process Explorer to be a more convenient tool, even if it *is* an additional install :}
moobaa
+1  A: 

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.

Guge
A: 

Process Explorer will show you some of this if you double-click on on a process.

nzpcmad
A: 

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.

flesh
A: 

I use memprofiler as well and it helped us out tremendously.

TheCodeMonk