Search code examples
c#.netmemory-managementnew-operatorprofiler

Cannot detect unmanaged memory allocations in .NET


I want to determine the source of huge memory consumption of my app. My application is eating a lot of virtual memory (VM column in task manager or private bytes in VMMap)

My application is .net service but it uses C# wrappers around C++ objects.

I tried Red Gate Ants Memory profiler but it counts only managed objects and does not count memory allocated by unmanaged C++ new operator (which is simply calling Virtual Alloc).

Another problem with managed memory profiler is that does not allow to trace call graph - see picture below.

enter image description here

enter image description here


Solution

  • You can use DebugDiag. It will track C# and C++ objects.