关于ICE在MFC调试环境下的内漏问题

35 篇文章 0 订阅
6 篇文章 0 订阅

最近用VC2010在使用ICE的过程中,发现调试有内漏,曾经在VC6的年代用过ICE确实也有过这问题。官方有过一个比较确切的说法:

 

转自:http://www.zeroc.com/faq/mfcLeakDetector.html

 

Why does the MFC leak detector report memory leaks with Ice?

 

When running a debug version of an MFC application that links with the Ice libraries, after the application terminates, you may see something similar to the following in the IDE debug window:

Detected memory leaks!
Dumping objects ->
{77} normal block at 0x00475768, 16 bytes long.
Data: < WG hWG > 18 57 47 00 68 57 47 00 00 00 00 00 00 00 00 00
{75} normal block at 0x00475A90, 1808 bytes long.
Data: <0123456789ABCDEF> 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46
{74} normal block at 0x00472FE0, 28 bytes long 
... 

We have tested the Ice run time extensively and are confident that it does not harbor memory leaks—even when MFC is used. The erroneous leak reports are caused by the use of static variables in the Ice libraries, such as instances of std::string. These instances allocate memory when they are constructed, but have not released the memory at the time the Microsoft memory tracker runs its leak detection routines. This is annoying and, unfortunately, there is no known solution to this problem.

Of course, it is always possible that your application has real memory leaks, so it is best to use a leak detector to help track down such bugs. However, we recommend that you ignore the output from the Microsoft memory tracker and instead use a leak detector that does not suffer from this problem, such as Rational Purify.

 

有时间真的要拿Purify进行内漏检测看看。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值