Memory Allocation
Hi ,
I got some list of issues(High GC Pressure ) generated by default from dotMemory after profiling. Here the allocated memory is showing 80.74 GB. I am just started learning about dot net memory management and dotMemory profiling. I am little bit confused about the allocated memory size(i.e. 80.74GB). In My system I have only 16 GB of RAM and even only 84 GB of free space in my Hard disk. Can you please help me with this that actually where this memory got allocated?
What are the best ways to resolve these issues from our application?
Please sign in to leave a comment.
Hi!
When an object is not referenced by any other objects in your program (in fact by GC roots but let's simplify the things), it is "deleted" or collected by the Garbage Collector. As I see on the screenshot the program created ~80Gb of objects in ~24 minutes. These objects are not in the memory at the same time. Your program creates objects and then release them and create again and so on and so forth. Each yellow mark in the bottom part of the chart is the execution of garbage collecting which collects objects already released by your application.
As I see on the second screenshot most of this memory traffic are objects of the type string, which, as I'm sure you know, are immutable objects and any manipulation on them like concatenation of two or more strings leads creating the new object.
Read more about analyzing memory allocations in the dotMemory documentation article https://www.jetbrains.com/help/dotmemory/Analyze_Memory_Allocation.html