The memory area used by the unmanaged component to allocate / free

Suppose a managed .net application interacts with an unmanaged component through InterOP. If I need to debug a memory problem; where exactly does the unmanaged component allocate memory? Is this the same heap used by the GC (which I doubt), or are these some other areas? I am debugging Windbg and wondering if I can look at distribution by an unmanaged component through SoS commands such as! Dumpheap?

+4
source share
1 answer

In Windbg, you can use !heap Heap to check the !heap 's internal memory . The GC (managed) heap is not related to using the heap of native code, although at some level my assumption is that the managed heap should map (inside the CLR) to one or more native heaps.

SoS is used exclusively for debugging managed code. WinDbg is, first of all, a tool for debugging native code.

umdh.exe may also be useful, although I have not tried this in a mixed-mode application.

+3
source

All Articles