Real-time tab 'Total bytes' when is it captured?

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 1
Joined: Thu Jan 31, 2013 7:15 pm

Real-time tab 'Total bytes' when is it captured?

Post by ryandale56 » Thu Jan 31, 2013 7:32 pm

Started nmpcore.exe /asp on server at 6am and take a snapshot at 6:10am and another at 6:20am, allowed nmpcore.exe to continue running until 10am then profiler was closed and it saved the session file.

When I look at the Real-time tab, are the Total instances and Total bytes columns from 10am? Is it the total instances created over the period of the profile or just a snapshot of the total instances just before closed profiler was closed?

I'm asking because I did have a memory spike at 10am and tried to do a snapshot, but profiler failed to create the snapshot due to an 'unexpected' error. When I look in the real-time tab I see some 'total instance' counts in the millions (highest is almost 10,000,000) and total bytes count is 800MB. An example is that in the overview tab System.String shows 102,654 live instances, but in the Real-time tab is shows 630,000. So again, my question whether the 630,000 is concurrent or a count of all instances created during the 4 hour profile?

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

Re: Real-time tab 'Total bytes' when is it captured?

Post by Andreas Suurkuusk » Fri Feb 01, 2013 1:38 pm

The real-time Total bytes value reflects the number of bytes used by instances that exist on the managed heap at a specific point in time. The instances are not necessarily reachable from a root, but they are still a part of the heap. So at one time you have had 630,000 string instances on the heap. You can get more information about the real-time graph here and here.

To find out why you have so many more instances on the heap than what you see in your snapshot, I recommend that you try to collect peak snapshots. If peak snapshot collection is enabled, a snapshot is collected each time the total bytes reaches a new peak value (when a GC is initiated by the runtime). The peak snapshot contains additional information about number of instances and bytes that were collected during the corresponding GC. For more information see the online documentation.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests