Windows应用程序中的内存泄漏 [英] Memory Leak in windows app

查看:81
本文介绍了Windows应用程序中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





请不要将此问题标记为转贴,我发布了一个关于内存泄漏的问题,将其放在评论中,没有回复,所以重新发布。<在我用C#.NET 2.0开发的Windows应用程序中,





我尝试使用Debugdiag调试问题,它显示在libs下面的内存泄漏,这些是发生泄漏的dll,在这段时间内这些dll的泄漏增加,导致应用程序崩溃,请建议可以做什么。



我使用的是.NET framework 2.0,我的应用程序是32位。



mscorwks.dll负责121.05 MB的未完成分配。以下是前2个内存消耗功能:



mscorwks!EEVirtualAlloc + 119:120.69 MBytes的未完成分配。



mscorwks!DebuggerHeap :: Alloc + 2f:284.07 KBytes的未完成分配。如果这是意料之外的,请联系此模块的供应商,Microsoft Corporation,以获得有关此问题的进一步帮助。



警告WindowsCodecs.dll负责13.51 MB的值未完成的拨款。以下是前2个内存消耗函数:



WindowsCodecs!WPF :: ProcessHeapImpl :: Alloc + 16:13.43 MBytes的未完成分配。



WindowsCodecs!zcalloc + 1c:86.67 KB的未完成分配。



谢谢,

Shreyas



Please do not mark this question as repost , i posted a question on memory leak , placed this in comments , no response so reposting it .

for my windows application developed in C#.NET 2.0

I tried to debug the issue using Debugdiag , it showed memory leak in below libs ,

these are the dlls where leak occurs , over i period time the leak for these dlls increases , leading to application crash, Please suggest what can be done.

I am using .NET framework 2.0 and my application is 32 bit.

mscorwks.dll is responsible for 121.05 MBytes worth of outstanding allocations. The following are the top 2 memory consuming functions:

mscorwks!EEVirtualAlloc+119: 120.69 MBytes worth of outstanding allocations.

mscorwks!DebuggerHeap::Alloc+2f: 284.07 KBytes worth of outstanding allocations. If this is unexpected, please contact the vendor of this module, Microsoft Corporation, for further assistance with this issue.

Warning WindowsCodecs.dll is responsible for 13.51 MBytes worth of outstanding allocations. The following are the top 2 memory consuming functions:

WindowsCodecs!WPF::ProcessHeapImpl::Alloc+16: 13.43 MBytes worth of outstanding allocations.

WindowsCodecs!zcalloc+1c: 86.67 KBytes worth of outstanding allocations.

Thanks,
Shreyas

推荐答案

这些是COM DLL吗? br />
如果是这样,你必须确保正确释放与COM对象一起使用的.NET对象。

参见如何释放COM互操作对象,以便被叫程序可以退出 [ ^ ]



另外,请参阅以下文章:

非托管内存泄漏在mscorwks帮助分析 [ ^ ]



FIX:发生内存泄漏当托管应用程序使用ap时latform调用调用以在.NET Framework 2.0中调用非托管函数 [ ^ ]



FIX:您可能会注意到内存运行基于.NET Framework 2.0构建的应用程序时,加载非常高 [ ^ ]



...更多可通过Google搜索获取
Are these COM DLLs?
If so, you have to be sure to properly release the .NET objects used with the COM object.
See How to Release COM Interop Objects so the Called Program Can Exit[^]

Also, see these articles:
Unmanaged memory leak in mscorwks help analyze[^]

FIX: A memory leak occurs when a managed application uses a platform invoke call to call an unmanaged function in the .NET Framework 2.0[^]

FIX: You may notice that the memory load is very high when you run an application that is built on the .NET Framework 2.0[^]

... more available via Google search


这篇关于Windows应用程序中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆