resource leakage detection on Windows

Time frame: May 2011

Subject: Investigate resource leakage of a VC++ native application on Windows XP SP3.

DevPartner 10.5 - cause debuggee crash due to 0x80080003. After disabling certain features so that it only logs memory leaks, the debuggee does not crash, but hang up at exit.

Purify 7.0.1 cause debuggee exit abnormally, no memory leakage found.

Intel Parallel Inspector 2011 can only work inside VC++ 2008, so I have to open a solution, then start error inspection, browse to my executable and run. It is a little bit slow, but it did found some resource leakages. Some of the leakage has call stack, file name and line number information, but others only show "unkown". The callstack depth is only 2. 

Intel Parallel Composer 2011 provides a code coverage tool - profmerge and codecov.exe.

Steps: enable "Instrument for Code Coverage" in Project properties -> General -> Code Coverage Build Options

Compiler and Environment Settings: Intel C++ Compiler (icl.exe)

Run program with "Hotspots - Where is my program spending time?"

Open C:/WINDOWS/system32/cmd.exe /E:ON /K ""C:/Program Files/Intel/Parallel Studio 2011/ips-vars.cmd" ia32 vs2008"

generate pgopti.dpi by this command: G:/workspace/testvld2/Debug>profmerge

G:/workspace/testvld2/Debug>codecov -prj testvld2

 

 

Intel(R) C++ Compiler XE 12.0.2.154 [IA-32]... (Intel C++ Environment)

1>Linking... (Intel C++ Environment)

1>ipo: error #11018: Cannot open X:/server/Base/

1>xilink: executing 'link'

1>LINK : fatal error LNK1181: cannot open input file 'X:/server/Base/.obj'

 

This is due to empty value in Base project Linker -> Advanced -> Import Library (/IMPLIB linker option).  Set the value as: $(TargetDir)$(TargetName).lib, then rebuild is successful.

 

Valgrind is able to do memory checking and profiling on Linux.

 

Memory Validator  is not compatible with Visual Leak Detector. It also reported incorrect source code position when executable is not built with VLD. 

 

Maybe next time I'll try Microsoft tools if none of the above is working well.

Umdhtools.exe: How to use Umdh.exe to find memory leaks

Memory Leak Detection Using Windbg By Mayank Rai

Q177415 How to use Memory Pool Monitor (Poolmon.exe) to troubleshoot kernel mode memory leaks

Detect and Plug GDI Leaks in Your Code with Two Powerful Tools for Windows XP by Christophe Nasarre

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值