What is the non .net memory shown in dotmemory

I do have an application which uses a total of 2GB of memory, but only 553mb of this 2GB are shown as .net. 

This is a pure .net application. 

There was already an issue with the exact same question and a link to your issuemanagement, but it seems without resolution available to the public. (https://dotnettools-support.jetbrains.com/hc/en-us/community/posts/360007078619--NET-Total-memory-6GB-unknown-)

 

How can i see what exactly is using 1.4GB of memory in my application?

0
1 comment

Hello,

Snapshot contains information about Total, .NET Total and .NET Used memory values.

Total memory consists of "unmanaged" memory and ".NET, total" memory. dotMemory uses PROCESS_MEMORY_COUNTERS.PagefileUsage to get this value: https://docs.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-process_memory_counters?redirectedfrom=MSDN Usually, this size is similar to Windows Task Manager's Commit size: the amount of memory requested by a process. 

Unmanaged memory is memory allocated outside of the managed heap and not managed by Garbage Collector. Generally, this is the memory required by .NET CLR, dynamic libraries, graphics buffer, and so on. This part of memory cannot be analyzed in dotMemory.

.NET, total is the amount of memory in the managed heap used by the app including free space between allocated objects. .NET, total = ".NET, used" + free memory. Free memory may be reserved by CLR to perform future allocations faster. You can't affect this CLR behaviour. Anyway, free memory should be released in case of lack of resources.

".NET, used" is the amount of memory in the managed heap used by the app excluding free space. This is the only part of memory .NET allows you to work with. You can get all these objects in dotMemory snapshot.

dotMemory is a pure .NET memory profiler and doesn't present info about unmanaged memory except total value. Please try to use "Collect native allocations" feature in dotTrace to get information about native memory allocations: https://www.jetbrains.com/help/profiler/Native_Memory_Allocation.html


> There was already an issue with the exact same question and a link to your issuemanagement, but it seems without resolution available to the public. (https://dotnettools-support.jetbrains.com/hc/en-us/community/posts/360007078619--NET-Total-memory-6GB-unknown-)


This issue was about difference between .NET, total value presented in Heap Fragmentation inspection and in Snapshot area. It related to unreachable managed objects size which weren't included neither to .NET used (because .NET used is size of reachable objects existing in snapshot) nor to free memory. This bug was actually fixed in dotMemory 2020.1 and it doesn't relate to your question: https://youtrack.jetbrains.com/issue/DMRY-7822

0

Please sign in to leave a comment.