Not all memory reported in profiler

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 3
Joined: Fri Nov 02, 2012 5:55 am

Not all memory reported in profiler

Post by peterjc » Fri Nov 02, 2012 6:17 am

Hi, I have collected a snapshot from a process that seems to be leaking memory (using the nmpCore). When I look in task manager, it reports the process using over 1 gig of memory, however when I load the snapshot into the memory profiler gui, the total of the total live bytes only shows just over half a gig.

Would any one know why we don't see the same total value in here as task manager reports?

Thanks in advance for an help,

Andreas Suurkuusk
Posts: 1030
Joined: Wed Mar 02, 2005 7:53 pm

Re: Not all memory reported in profiler

Post by Andreas Suurkuusk » Fri Nov 02, 2012 12:54 pm

When you collect a snapshot, the profiler forces the .NET runtime to cleanup as much memory as possible (by performing multiple garbage collections and allowing finalizers to run). This avoids presenting instances that are eligible for garbage collection, but it will also decrease the amount of memory used by the instances in the snapshot. To get information about all memory used by the process, you can use the Native memory page. Under this page, all memory used by the process is presented, including managed memory used by live instances, unused managed memory, and the unmanaged memory usage.

You can get more information about the total managed memory usage by collecting the snapshot using the "Collect gen #0 snapshot" command, or by collecting a peak snapshot. A gen #0 snapshot will not perform any heap cleanup, and will include information about unreachable instances. A peak snapshot also includes information about instances collected by the garbage collector.

To get information more information about unmanaged memory usage, you can try to enable the unmanaged resources tracker.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests