Live Bytes vs Total Bytes in Graph

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.

Moderator: SciTech Software

Live Bytes vs Total Bytes in Graph

Postby jeffwalsh » Tue May 15, 2018 7:47 pm

How can the Live Bytes be higher than the total bytes. Is this a bug?
See attachment
Live vs Total Bytes.png
Real time graph
Posts: 2
Joined: Tue May 15, 2018 7:43 pm

Re: Live Bytes vs Total Bytes in Graph

Postby Andreas Suurkuusk » Thu May 17, 2018 1:23 pm

It's not a bug. It is caused by an optimization in the profiler and the way live bytes data is presented in the real-time view. Collecting information about live instances is very time-consuming. The profiler has to analyse the full managed heap in order to determine which instances are actually reachable from a root. This is the same analysis that the runtime has to perform when doing a full gen #2 garbage collect. And the garbage collector would become very slow if only full gen #2 GCs could be performed.

To prevent very bad performance when collecting real-time data, the profiler will only spend a small amount of time to make a full heap analysis. I don't remember the exact numbers, but I think it's something like 10% of the time. So if it takes 0.1 seconds to do a full heap analysis, it will only be done once per second. Each time a full analysis is performed, the result will be presented with a marker in the real-time view. Between marker it will connect a horizontal line, to make it easier to view the information (see screenshot).


It is possible to hide the connecting line by using the "Connect GC data" button (see screenshot).


So as long as the marker is equal to or lower that the total bytes count, there's most likely no bug.
Best regards,

Andreas Suurkuusk
SciTech Software AB
Andreas Suurkuusk
Posts: 995
Joined: Wed Mar 02, 2005 7:53 pm
Location: Sweden

Re: Live Bytes vs Total Bytes in Graph

Postby jeffwalsh » Thu May 17, 2018 2:38 pm

Great explanation. Thanks for clarifying.
Posts: 2
Joined: Tue May 15, 2018 7:43 pm

Return to Using .NET Memory Profiler

Who is online

Users browsing this forum: No registered users and 7 guests

SciTech Software logo

© Copyright 2001-2016. SciTech Software AB
All rights reserved.

SciTech Software AB
Kartvägen 21
SE-175 46 Järfälla


Telephone: +46-706868081