Difference between CLR Heap Memory and Retained Size
-
- Posts: 3
- Joined: Tue Mar 28, 2017 12:41 pm
Difference between CLR Heap Memory and Retained Size
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.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Difference between CLR Heap Memory and Retained Size
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.
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.
-
- Posts: 3
- Joined: Tue Mar 28, 2017 12:41 pm
Re: Difference between CLR Heap Memory and Retained Size
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
Thanks
Richard
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Difference between CLR Heap Memory and Retained Size
Hello Richard
Unfortunately, you cannot see the fragmentation explicitly in the profiler. Pinned objects can be seen via "Memory |GC Roots".
Best regards,
Anton
Unfortunately, you cannot see the fragmentation explicitly in the profiler. Pinned objects can be seen via "Memory |GC Roots".
Yes, please. If you cannot share them in the forum please send them (or a download link) to support@yourkit.comIf you want I can send you my memory snapshots or screenshots of what I am seeing in the tool now.
Best regards,
Anton