查看.Net中非托管内存的内存内容
我有一个第三方C/C++DLL,我使用查看.Net中非托管内存的内存内容,.net,memory,memory-leaks,dllimport,.net,Memory,Memory Leaks,Dllimport,我有一个第三方C/C++DLL,我使用DllImport调用它: internal static class wrapper { [DllImport("vendor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int execute_action(int a, int b); [DllImport("vendor.dll", CallingConvention = C
DllImport
调用它:
internal static class wrapper {
[DllImport("vendor.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int execute_action(int a, int b);
[DllImport("vendor.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int free_memory();
}
我怀疑我调用的“空闲内存”方法实际上并没有释放它所寻址的所有内存,但可能只是测量结果有误,内存被返回到进程而不是操作系统
我可以检查进程的非托管部分存储在内存中的内容吗?我尝试了ANTS内存探查器,但我当然只能检查托管内存…DLL不拥有内存。过程确实如此。如果您想测试,只需在循环中运行分配-取消分配循环,看看它是否可以永远运行。当然,很抱歉出现了快捷方式。。。这是一个有趣的想法,但它不能回答问题。因为问题的关键是这个问题没有答案,因为DLL没有内存。。。