VLD2.0b doesn't work

Oct 18, 2010 at 9:32 AM

Hi all:

    My environment is VLD2.0b + VS2008 +WinXP SP3. I have setup the VLD2.0b correctly in VS2008, but when I run this demo program ( It is only a CONSOLE demo program), it say that no memory leak founded.

#include "vld.h"

void main(void)
    void *pStr = malloc(10);

I am sure that VLD2.0b is working, because when I set SelfTest = on, I could found the memory leak information in output window. But why it can't detect memory leak on my demo program ? The buffer of 'pStr' is definitely leaked.  Can anybody tell me why?

    Thanks and best regards.


Oct 18, 2010 at 6:20 PM

Did you check whether VLD is enabled from the start? (another option in vld.ini).

I assume since the selftest is running that you're running in Debug mode?

Oct 19, 2010 at 1:09 AM


    Thank you for your reply. Yes, the VLD option is on in the vld.ini (VLD = on). I only want to make sure that VLD is running when I enable the SelfTest option. And I am sure that VLD is definitely working.  My demo program is really in debug mode, I run this demo program step by step, and until it ended, I only get these info:

“oamdm.exe”: 已加载“E:\project\hnb\projdemo\oamdm\oamdm\Debug\oamdm.exe”,已加载符号。
“oamdm.exe”: 已加载“C:\WINDOWS\system32\ntdll.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\kernel32.dll”
“oamdm.exe”: 已加载“E:\project\hnb\projdemo\oamdm\oamdm\libxml2.dll”,已加载符号。
“oamdm.exe”: 已加载“C:\WINDOWS\system32\wsock32.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\ws2_32.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\advapi32.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\rpcrt4.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\secur32.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\msvcrt.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\system32\ws2help.dll”
“oamdm.exe”: 已加载“C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e\msvcr90.dll”
“oamdm.exe”: 已加载“E:\project\hnb\projdemo\oamdm\oamdm\Debug\vld_x86.dll”
“oamdm.exe”: 已加载“E:\project\hnb\projdemo\oamdm\oamdm\Debug\dbghelp.dll”
Visual Leak Detector Version 2.0b installed.
Thread 'Win32 Thread' (0x454) 已退出,返回值为 0 (0x0)。
No memory leaks detected.
Visual Leak Detector is now exiting.
程序“[3664] oamdm.exe: 本机”已退出,返回值为 0 (0x0)。