Comparing .NET CLR Memory\# Bytes in all Heaps

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
krishnakumar
Posts: 1
Joined: Thu Jul 28, 2011 9:40 am

Comparing .NET CLR Memory\# Bytes in all Heaps

Post by krishnakumar » Thu Jul 28, 2011 9:53 am

Which data in real time tab corresponds to the perfmon counter - .NET CLR Memory\# Bytes in all Heaps?
I profiled a .Net 4.0, WPF GUI application. The perfmon counter (# Bytes in all Heaps) shows 68 MB where as the Live Bytes in memory snapshot shows 46 MB after first iteration.
How do I relate these two information?
Attachments
grp3_22507.png
grp3_22507.png (25.2 KiB) Viewed 7783 times

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

Re: Comparing .NET CLR Memory\# Bytes in all Heaps

Post by Andreas Suurkuusk » Thu Jul 28, 2011 7:54 pm

There's no number in the real-time plot in .NET Memory Profiler that directly corresponds to the perfmon counter ".NET CLR Memory\# Bytes in all Heaps". I'm not exactly sure what the number represents, but I as far as I remember, it is the total number of bytes committed for the managed heaps. The perfmon number should always be greater than the total bytes number. However, the total bytes number is updated for each managed allocation while the perfmon counter is updated less frequently. After a GC, the runtime might release some unused memory to the OS, but not necessarily all, since it want to keeps some memory for future allocations. So even after a GC, the perfmon counter will be higher than the live bytes and total bytes real-time value.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests