托管+非托管应用程序内存泄漏问题 [英] Managed + unmanaged application memory leak problem

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

问题描述

我在COM组件(使用vb6创建)上有一个包装管理的应用程序(.net),其中COM组件也使用本机c ++ dll.

应用程序作为后台进程运行,并且应该连续运行24 X7.
该应用程序可以在一段时间内正常运行,但在一段时间后会崩溃.
可能的原因可能是c ++ dll或com组件中的内存泄漏.
COM和c ++ dll.

由于我不熟悉com和c ++,因此我尝试从托管解决问题
应用.我正在考虑通过以下方式解决:托管应用程序是否启动?
消耗大量内存,然后我将重新启动托管的应用程序.

1)我们如何以编程方式监视应用程序使用的总内存(托管+非托管).

2)重新启动托管应用程序还会释放非托管资源.

3)还有其他替代方法吗?

4)什么是监视托管应用程序的最佳调试工具?
非托管资源.


如果我的解释不清楚,请再次询问我.

任何帮助将不胜感激.

I have a wrapper managed application(.net) over a COM Component(created using vb6) where Com component also uses native c++ dll.

Application runs as a background process and is supposed to run continuously 24 X 7.
The application runs fine for certain time, but after certain time it crashes.
Possible reasons might be memory leak in c++ dll or com component.There is a lot of code for
COM and c++ dll's.

Since i am not familiar with com and c++, i am trying to resolve the problem from managed
application. I am thinking for resolving this way : if the managed application starts 
consuming a lot of memory then i will restart my managed application.

1) How can we programatically monitor the total memory used by application (managed + unmanaged).

2) Would restarting the managed application also free up the unmanaged resources.

3) Is there any other alternative approach.

4) what are best debugging tools for monitoring managed application which also used
unmanaged resources.


If i am not clear in my explanation then do ask me again.

Any help will be greatly appreciated.

推荐答案

Process.GetCurrentProcess().WorkingSet64

Process.GetCurrentProcess().WorkingSet64


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

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