Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Difference between CLR Heap Memory and Retained Size

Moderators: Vladimir Kondratyev, Anton Katilin

Difference between CLR Heap Memory and Retained Size

Postby rkarner@husky.ca » Tue Mar 28, 2017 1:14 pm

I am seeing a large difference between the Objects by Generation View retained size (260 MB) and the CLR Heap Memory (Used 508 MB, Allocated 522 MB). How can these numbers be so different? Why don't I see where the extra memory is being used? I am trying to figure out a memory leak we have and the snapshot difference shows a difference of only 3.6 MB whereas the CLR Heap Memory difference is 172 MB. Thanks for your help.
rkarner@husky.ca
 
Posts: 3
Joined: Tue Mar 28, 2017 12:41 pm

Re: Difference between CLR Heap Memory and Retained Size

Postby Anton Katilin » Tue Mar 28, 2017 2:33 pm

CLR Heap Memory graph shows total memory allocation for heap storage as reported by CLR. This includes heap storage overhead: gaps between objects, control structures etc.

The object views show a sum of all object individual sizes. I think we should attribute this difference to the above mentioned overhead.

Anyway, both the total sizes shown in the graph and the sum of object sizes shown in tables are exactly the values reported by the CLR. The profiler doesn't calculate them, just shows.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: Difference between CLR Heap Memory and Retained Size

Postby rkarner@husky.ca » Wed Mar 29, 2017 3:23 pm

I am thinking maybe I have a Gen 2 heap fragmentation issue because of pinned objects on the managed heap. Is there any way I can use YourKit to help me figure that out? If you want I can send you my memory snapshots or screenshots of what I am seeing in the tool now.

Thanks

Richard
rkarner@husky.ca
 
Posts: 3
Joined: Tue Mar 28, 2017 12:41 pm

Re: Difference between CLR Heap Memory and Retained Size

Postby Anton Katilin » Thu Mar 30, 2017 2:25 pm

Hello Richard

Unfortunately, you cannot see the fragmentation explicitly in the profiler. Pinned objects can be seen via "Memory |GC Roots".

If you want I can send you my memory snapshots or screenshots of what I am seeing in the tool now.

Yes, please. If you cannot share them in the forum please send them (or a download link) to support@yourkit.com

Best regards,
Anton
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 2 guests