how to watch where is problem on unmanage memory leak

I create a c# code that allocate context each time and not release it.

I do that to test the dotMemory tool


so you can see that unmanage memory is increase

but I want to see the detail why is that increase?  I looking for any clue where is the problematic code so I enter to 1 of the snapshot  


and I not see any clue where is the problem, any clue to the problematic unmanage object that I can looking and find on my code

is there any clue in dotMemory?


Comment actions Permalink
Official comment

what exactly do you mean by "allocate context each time"?

dotMemory is the profiler for managed memory so, regarding to unmanaged memory, it can show only managed objects which hold or represent some unmanaged resource. For example if you create a bitmap or open a file stream and forgot to dispose them, such objects will be reported in "Finalizable objects" inspection due to they have finalizer. If app allocates some unmanaged memory manually for using in the managed part, usually such objects should be "pinned" and will be shown on the heaps fragmentation map at the bottom of "Inspection" view presented on your second screenshot.

Comment actions Permalink

Can I watch the unmanage object that create on m dot net application in dotMemory tool??? or is there another tool that I can diagnose unmanage memory ?

Comment actions Permalink

dotMemory is a pure .NET memory profiler. Unfortunately, you can't inspect unmanage objects in memory snapshot.

Some specific tools can allow you to get information about unmanaged memory of your application. For example, WinDbg is one of them.


Please sign in to leave a comment.