Visual Leak Detector

支智志
2023-12-01

ProjectDescription

Visual Leak Detector is a free, robust, open-source memory leak detectionsystem for Visual C++.

It's pretty easy to use. After installing it, you just need to tell Visual C++where to find the included header and library file.

Then it can be used with any C/C++ project simply by adding the following lineto your code:
#include <vld.h> 

When you run your program under the Visual Studio debugger, Visual LeakDetector will output a memory leak report at the end of your debugging session.The leak report includes the full call stack showing how any leaked memoryblocks were allocated. Double-click on a line in the call stack to jump to thatfile and line in the editor window.

It's a very effective way to quickly diagnose, and fix, memory leaks in C/C++applications.

The main difference between the CRT Debug Library and VLD, is that Visual Leak Detector shows you the complete callstack used for memory allocation has led to the leak.

For example:

---------- Block1199 at 0x04BE1058: 136 bytes ----------

Call Stack:

d:\Foobar\FooLog.cpp(26): FooLog::getInstance

d:\Foobar\FooMain.cpp(75): FooMain::init

f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c(578): __tmainCRTStartup

f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c(403): WinMainCRTStartup

0x759A3677 (Fileand line number not available): BaseThreadInitThunk

0x770C9D42 (Fileand line number not available): RtlInitializeExceptionChain

0x770C9D15 (Fileand line number not available): RtlInitializeExceptionChain

Data:

9C 33 2D 6B    74 2A 2D 6B    C8 11 BE 04    00 00 00 00     .3-kt*-k ........

00 00 00 00    70 14 BB 6C    70 14 BB 6C    00 00 00 00     ....p..l p..l....

00 00 00 00    68 14 BB 6C    68 14 BB 6C    00 00 00 00     ....h..l h..l....

00 00 00 00    6C 14 BB 6C    6C 14 BB 6C    20 12 BE 04     ....l..l l..l....

00 00 00 00    CD 00 CD CD    00 00 00 00    01 CD CD CD     ........ ........

68 14 BB 6C    78 33 2D 6B    00 00 00 00    00 00 00 00     h..lx3-k ........

00 00 00 00    01 02 00 00    06 00 00 00    00 00 00 00     ........ ........

00 00 00 00    00 00 00 00    88 11 BE 04    5C 10 BE 04     ........ ....\...

00 00 00 00    20 CD CD CD                                   ................

This software is provided "ASIS" without warranty of any kind.

The project was originally developed by
 Dan Moulding, but they are no longer supported. Features ofversion 2.0 are implemented by Arkadiy Shapkin (me).

Links

·        Visual Leak Detector Previous Official Homepage http://sites.google.com/site/dmoulding/vld

·        CodeProject article: Visual Leak Detector - EnhancedMemory Leak Detection for Visual C++

·        Finding Memory Leaks Using the CRT Library

·        Visual Leak Detector: InvestigateMemory Leaks in Visual C++

Last edited Sep 30,2012 at 6:43 AM by KindDragon, version 18

 

 

Introduction


Visual C++ provides built-in memory leak detection, but its capabilities areminimal at best. This memory leak detector was created as a free alternative tothe built-in memory leak detector provided with Visual C++. Here are some ofVisual Leak Detector's features, none of which exist in the built-in detector:

·        Provides a complete stack trace for each leaked block,including source file and line number information when available.

·        Detects most, if not all, types of in-process memoryleaks including COM-based leaks, and pure Win32/Win64 heap-based leaks.

·        Selected modules (DLLs or even the main EXE) can beexcluded from leak detection.

·        Provides complete data dumps (in hex and ASCII) of leakedblocks.

·        Customizable memory leak report: can be saved to a fileor sent to the debugger and can include a variable level of detail.

Other after-market leak detectors forVisual C++ are already available. But most of the really popular ones, likePurify and BoundsChecker, are very expensive. A few free alternatives exist,but they're often too intrusive, restrictive, or unreliable. Visual LeakDetector is currently the only freely available memory leak detector for VisualC++ that provides all of the above professional-level features packaged neatlyin an easy-to-use library.

Visual Leak Detector is licensed free of charge as a service to the Windowsdeveloper community. If you find it to be useful and would like to just say
 "Thanks!", or you thinkit stinks and would like to say "This thing sucks!", please feelfree to write review for recent release. Or, if you'd prefer, you cancontribute a small donation. Both are very appreciated.

Last edited Apr 5,2011 at 4:54 AM by KindDragon, version5

comments

kasicass Oct 18 at 12:28 PM 

Excellent tool~ I like it :)

nbolton Jul 10, 2012 at 1:04 AM 

KindDragon, VLD is an excellent tool! Iregistered on CodePlex just to tell you that.

mainantagonist Jan30, 2012 at 3:51 PM 

I found this tool to be very useful andeasy to use. I think it's the number one free solution to the memory leaksproblem in vs 2010. Thank you so much KindDragon.

 

 

Using Visual Leak Detector


This section briefly describes the basics of using Visual Leak Detector (VLD).

Important!
 : Before usingVLD with any Visual C++ project, you must first add the Visual Leak Detectorinclude and library directories to the Visual C++ include and library directorysearch paths:
For all compiler versions take care to ensure that no junkcharacters get added when you add the include and library paths. If you browseto the "Program Files(x86) folder using the dialog box provided by VisualStudio and select it you could end up seeing the "%" replacing the"(".
 

And remember to close and open the Visual Studio IDE once you havemodified the default include and library paths which the compiler and linkerwould always look at.


·        Visual C++ 2010/2012/2013: Go to View->Property Manager, select Microsoft.Cpp.Win32.user. SelectVC++ Directories and then "Includefiles" from the tree. Add the include subdirectoryfrom the Visual Leak Detector installation directory. Move it to the bottom ofthe list. Then select "Library files" from thedrop-down menu and add the lib\Win32 subdirectoryfrom the Visual Leak Detector installation directory. Again, move it to thebottom of the list. Repeat for Microsoft.Cpp.x64.user, but select lib\Win64subdirectoryinstead.

·        Visual C++ 2005 and 2008: Go to Tools-> Options -> Projects and Solutions-> VC++ Directories. Select"Include files" from the "ShowDirectories For" drop-down menu. Add the include subdirectoryfrom the Visual Leak Detector installation directory. Move it to the bottom ofthe list. Then select "Library files"from thedrop-down menu and add the lib\Win32 subdirectoryfrom the Visual Leak Detector installation directory. Again, move it to thebottom of the list.

·        Visual C++ 2003: Go to ProjectProperties -> C/C++ -> General -> Additional Include Directories and add theinclude subdirectory from the Visual Leak Detector installation directory. Moveit to the bottom of the list. Then select AdditionalLibrary Directories and add the lib\Win32 subdirectoryfrom the Visual Leak Detector installation directory. Again, move it to thebottom of the list.



To use VLD with your project, follow these simple steps:

1.      In at least one C/C++ source file from your program,include the vld.h header file. Itshould not matter which file you add the include statement to. It also shouldnot matter in what order the header is included in relation to other headers.The only exception is stdafx.h (or any otherprecompiled header). A precompiled header, such as stdafx.h, must always be thefirst header included in a source file, so vld.hmust be includedafter any precompiled headers.

2.      If your program contains one or more DLLs that you wouldalso like to check for memory leaks, then also include vld.h in at least onesource file from each DLL to be included in leak detection.

3.      Build the debug version of your program.



Note: Unlike earlier (pre-1.9) versions ofVLD, it is now acceptable to include vld.h in every sourcefile, or to include it in a common header that is included by many or allsource files. Only one copy of the VLD code will be loaded into the process,regardless of how many source files include vld.h.

VLD will detect memory leaks in yourprogram whenever you run the debug version. When you run the program under theVisual C++ debugger, a report of all the memory leaks detected will bedisplayed in the debugger's output window when your program exits (the reportcan optionally be saved to a file instead, seeReportFile under ConfigurationOptions).Double-clicking on a source file's line number in the memory leak report willtake you to that file and line in the editor window, allowing easy navigationof the code path leading up to the allocation that resulted in the memory leak.


Note: When you build release versions ofyour program, VLD will not be linked into the executable. So it is safe toleave vld.h included in your source files when doingrelease builds. Doing so will not result in any performance degradation or anyother undesirable overhead.

Last edited Today at1:20 AM by KindDragon, version7

comments

polomora Nov 12 at 6:12 PM 

Since my last comment I've started usingVLD with VS2012. Compared with VS2008, the time to shutdown our application(when VLD does its magic to collate any outstanding memory leaks) haslengthened enormously, from about 2 minutes to about 30 minutes. When VLD isdisabled via the vld.ini config file, the problem disappears, so this confirmsthat VLD is the problem.

polomora Jul 3 at 12:23 AM 

On further use, I noticed that thesummary total of the number of bytes leaked reported by VLD does not agree withthe sum of the reported leaked bytes. The summary number of leaks does agree.

I tested this using the following options:
[Options]
VLD = on
AggregateDuplicates = no
ForceIncludeModules =
MaxDataDump = 32
MaxTraceFrames =
ReportEncoding = ascii
ReportFile =W:\Main\EnsorApplication\Castor\Build\VC90NT\Castor\Win32\Debug\vld_leak_report.txt
ReportTo = file
SelfTest = off
StackWalkMethod = fast
StartDisabled = no
TraceInternalFrames = no
SkipHeapFreeLeaks = no

At the end of the generated report:
Visual Leak Detector detected 11470 memory leaks (774260 bytes).

When I use scripts to calculate these figures for myself
cat /cygdrive/c/Users/21ppm/Desktop/vld_leak_report.txt | grep "\-\-Block" | wc -l
11470 (correct)
cat /cygdrive/c/Users/21ppm/Desktop/vld_leak_report.txt | grep "\-\-Block" | cut -f2 -d':' | cut -f2 -d' ' | awk 'a+=$1; END{print a}'
361340 (reported total was 774260)

polomora Jun 27 at 4:19 PM 

Also registered with CodePlex just tothank you for such a useful tool. I used it with VS2008, and it worked like acharm.

One thing that is unclear in the Documentation -> Configuration Optionssection. This section states that a a local configuration of VLD can beconfigured by copying a version of the vld.ini configuration file to the"program's working directory". Is this the directory where theexecutable program and (optiionally) its DLLs are located? I tried this, and itdidn't work. So i've had to configure VLD using the master copy of vld.ini inthe VLD installation directory.

andersmw May 4 at 4:46 AM 

the "failed to initializeproperly" error was not cured for me.. I feel I've been __declspec-ed.

JPDworkin Mar 9at 4:35 PM 

After a little fiddling I was able toget your tool working and found my leak problem. A very nice job. Here are theissue I found for my application/installation so you can improve the tool anddocumentation:
1 - I work at a large corporation with strict policies. When I tried to run myapplication with VLD enabled, I got an 'application failed to initializeproperly' error on startup. This was finally cured by using: CACLS"C:\software\Visual Leak Detector\bin" /E /G BUILTIN\Users:R on thecommand line.

2 - The report did not reliably appear unless I explicitly added a call toVLDEnable in my main InitInstance and calling VLDReportLeaks as anothercommenter posted above.

raananb Feb 23 at 4:38 PM 

The instructions for Visual C++ 2010 donot apply as such to Visual C++ 2010 Express.
Some modifications would help:
 
1. In Properties management, you must select 'Debug | Win32' (in my case)before you can select 'VC++ Directories'.
2. Once VC++ Directories is selected, the wording '"include file"from the tree' is imprecise: replace with "add VLD/Include in 'IncludeDirectories'".

3axap Nov 23, 2012 at 8:58 PM 

You may need to add VLDEnable() functioncall somewhere in your code to enable the detector or VLDReportLeaks() tocreate a report. Though the report will appear only when application exits.

mjrtstr Nov 7, 2012 at 10:42 AM 

Installed vld, no problem. Specificallyset a function to cause a memory leak. Within that .cpp file, included<vld.h>. Called the known memory leaking function multiple times. Exitedthe program. NOTHING IN THE DEBUG OUTPUT WINDOW WHATSOEVER. What am I missing?

InsideOutCloud Jun9, 2012 at 12:56 AM 

Just as a note, the setup directions forVisual Studio 2010 also work for Visual Studio 11

 

 

Configuration Options


There are a several configuration options that control specific aspects ofVLD's operation. These configuration options are stored in the vld.iniconfiguration file. By default, the configuration file should be in the VisualLeak Detector installation directory. However, the configuration file can becopied to the program's working directory, in which case the configurationsettings in that copy of vld.ini will apply only when debugging that oneprogram.

VLD


This option acts as a master on/offswitch. By default, this option is set to "on". To completely disableVisual Leak Detector at runtime, set this option to "off". When VLDis turned off using this option, it will do nothing but print a message to thedebugger indicating that it has been turned off.

AggregateDuplicates

Normally, VLD displays each individualleaked block in detail. Setting this option to "yes" will make VLDaggregate all leaks that share the same size and call stack under a singleentry in the memory leak report. Only the first leaked block will be reportedin detail. No other identical leaks will be displayed. Instead, a tally showingthe total number of leaks matching that size and call stack will be shown. Thiscan be useful if there are only a few sources of leaks, but those few sourcesare repeatedly leaking a very large number of memory blocks.

ForceIncludeModules

In some rare cases, it may be necessaryto include a module in leak detection, but it may not be possible to includevld.h in any of the module's sources. In such cases, this option can be used toforce VLD to include those modules in leak detection. List the names of themodules (DLLs) to be forcefully included in leak detection. If you do use thisoption, it's advisable to also add vld.lib to the list of library modules inthe linker options of your project's settings.

Caution: Use this option only when absolutelynecessary. In some situations, use of this option may result in unpredictablebehavior including false leak reports and/or crashes. It's best to stay awayfrom this option unless you are sure you understand what you are doing.

MaxDataDump

Set this option to an integer value tolimit the amount of data displayed in memory block data dumps. When this numberof bytes of data have been dumped, the dump will stop. This can be useful ifany of the leaked blocks are very large and the debugger's output windowbecomes too cluttered. You can set this option to 0 (zero) if you want tosuppress data dumps altogether.

MaxTraceFrames

By default, VLD will trace the callstack for each allocated block as far back as possible. Each frame traced addsadditional overhead (in both CPU time and memory usage) to your debugexecutable. If you'd like to limit this overhead, you can define this macro toan integer value. The stack trace will stop when it has traced this number offrames. The frame count may include some of the "internal" frameswhich, by default, are not displayed in the debugger's output window (see TraceInternalFrames below). In somecases there may be about three or four "internal" frames at thebeginning of the call stack. Keep this in mind when using this macro, or youmay not see the number of frames you expect.

ReportEncoding

When the memory leak report is saved toa file, the report may optionally be Unicode encoded instead of using thedefault ASCII encoding. This might be useful if the data contained in leakedblocks is likely to consist of Unicode text. Set this option to"unicode" to generate a Unicode encoded report.

ReportFile

Use this option to specify the name andlocation of the file in which to save the memory leak report when using a fileas the report destination, as specified by the ReportTo option. If nofile is specified here, then VLD will save the report in a file named"memory_leak_report.txt" in the working directory of the program.

ReportTo

The memory leak report may be sent to afile in addition to, or instead of, the debugger. Use this option to specifywhich type of destination to use. Specify one of "debugger" (thedefault), "file", or "both".

SelfTest

VLD has the ability to check itself formemory leaks. This feature is always active. Every time you run VLD, inaddition to checking your own program for memory leaks, it is also checkingitself for leaks. Setting this option to "on" forces VLD tointentionally leak a small amount of memory: a 21-character block filled withthe text "Memory Leak Self-Test". This provides a way to test VLD'sability to check itself for memory leaks and verify that this capability isworking correctly. This option is usually only useful for debugging VLD itself.

SlowDebuggerDump

If enabled, this option causes VisualLeak Detector to write the memory leak report to the debugger's output windowat a slower than normal rate. This option is specifically designed to workaround a known issue with some older versions of Visual Studio where some datasent to the output window might be lost if it is sent too quickly. If younotice that some information seems to be missing from the memory leak report,try turning this on.

StackWalkMethod

Selects the method to be used forwalking the stack to obtain call stacks for allocated memory blocks. Thedefault "fast" method may not always be able to successfully tracecompletely through all call stacks. In such cases, the "safe" methodmay prove to be more reliable in obtaining the full stack trace. Thedisadvantage with the "safe" method is that it is significantlyslower than the "fast" method and will probably result in verynoticeable performance degradation of the program being debugged. In most casesit should be okay to leave this option set to "fast". If youexperience problems getting VLD to show call stacks, you can try setting thisoption to "safe".

If you do use the "safe"method, and notice a significant performance decrease, you may want to considerusing the MaxTraceFrames option to limitthe number of frames traced to a relatively small number. This can reduce theamount of time spent tracing the stack by a very large amount.

StartDisabled

Set this option to "yes" todisable memory leak detection initially. This can be useful if you need to beable to selectively enable memory leak detection from runtime, without needingto rebuild the executable; however, this option should be used with caution.Any memory leaks that may occur before memory leak detection is enabled atruntime will go undetected. For example, if the constructor of some globalvariable allocates memory before execution reaches a subsequent call toVLDEnable, then VLD will not be able to detect if the memory allocated by theglobal variable is never freed. Refer to the following section on controllingleak detection at runtime for details on using the runtime APIs which can beuseful in conjunction with this option.

TraceInternalFrames

This option determines whether or notall frames of the call stack, including frames internal to the heap, aretraced. There will always be a number of frames on the call stack which areinternal to Visual Leak Detector and C/C++ or Win32 heap APIs that aren'tgenerally useful for determining the cause of a leak. Normally these frames areskipped during the stack trace, which somewhat reduces the time spent tracingand amount of data collected and stored in memory. Including all frames in thestack trace, all the way down into VLD's own code can, however, be useful for debuggingVLD itself.

SkipHeapFreeLeaks

Determines whether or not report memoryleaks when missing HeapFree calls.

Last edited Apr 21,2012 at 1:26 AM by KindDragon, version3

comments

Controlling Leak Detection at Runtime


Using the default configuration, VLD's memory leak detection will be enabledduring the entire run of your program. In certain scenarios it may be desirableto selectively disable memory leak detection in certain segments of your code.VLD provides simple APIs for controlling the state of memory leak detection atruntime. To access these APIs, include vld.h in the source file that needs touse them.

VLDDisable

This function disables memory leak detection. After calling this function,memory leak detection will remain disabled until it is explicitly re-enabledvia a call to VLDEnable.

void VLDDisable (void); 

Arguments:

This function accepts no arguments.

Return Value:

None (this function always succeeds).

Notes:

This function controls memory leakdetection on a per-thread basis. In other words, calling this function disablesmemory leak detection for only the thread that called the function. Memory leakdetection will remain enabled for any other threads in the same process. Thisinsulates the programmer from having to synchronize multiple threads thatdisable and enable memory leak detection. However, note also that this meansthat in order to disable memory leak detection process-wide, this function mustbe called from every thread in the process.

VLDEnable
This function enables memory leak detection if it was previously disabled.After calling this function, memory leak detection will remain enabled unlessit is explicitly disabled again via a call to VLDDisable().

void VLDEnable (void); 

Arguments:

This function accepts no arguments.

Return Value:

None (this function always succeeds).

Notes:

This function controls memory leakdetection on a per-thread basis. See the remarks for VLDDisableregardingmultithreading and memory leak detection for details. Those same concepts alsoapply to this function.

Last edited Apr 5,2011 at 4:46 AM by KindDragon, version2

comments

bgolding May 31 at5:11 AM 

The full API (total 19 functions as ofvld 2.3) is pretty well documented in vld.h.

 

Building Visual Leak Detector fromSource


Because Visual Leak Detector is open source, it can be built from source if youwant to tweak it to your liking. As of Visual Studio 2008, the source canusually be built out-of-the-box without downloading or installing any othertools. If you are using Visual Studio 2008 (or later), you can skip ahead toExecuting Your Built vld.dll.
 

Users with older versions of Visual Studio should continue reading here andfollow the instructions in the next subsection.

For Older Versions of Visual Studio

The most difficult part about building VLD from source is getting your buildenvironment correctly set up. But if you follow these instructions carefully,the process should be fairly painless.

1.      VLD depends on the Debug Help Library. This library ispart of Debugging Tools for Windows (DTfW). Download and install DTfW in orderto install the required headers and libraries. I recommend installing version6.5 of DTfW, or later. Newer versions tend to work fine, but older versionswill probably not work. Be sure to manually select to install the SDK filesduring the DTfW installation or the headers and libraries will not be installed(they are not always installed with a default installation).

2.      Visual C++ will need to be made aware of where it canfind the Debug Help Library header and library files. Add the sdk\inc and sdk\lib\i368(sdk\lib\amd64) subdirectories from the DTfWinstallation directory to the include and library search paths in Visual C++.(See the section above on using Visual Leak Detector on instructions for addingto these search paths).

3.      VLD also requires a reasonably up-to-date MicrosoftWindows SDK. It is known to work with the latest SDK (as of this writing) which isthe Microsoft Windows SDK for Windows 7 and .NET Framework 4. It should alsowork with earlier SDKs, such as the Windows XPSP2 SDK. If in doubt,update your Microsoft Windows SDKto the latestversion.

4.      Again, Visual C++ will need to know where to find the MicrosoftWindows SDK headers and libraries. Add the Includeand Lib subdirectories from the Platform SDK installation directory to theInclude and Library search paths, respectively. The MicrosoftWindows SDK directories should be placed just afterthe DTfW directories.

To summarize, your Visual C++ includesearch path should look something like this:


C:\ProgramFiles\Debugging Tools for Windows (x86)\sdk\inc

C:\ProgramFiles\Microsoft SDKs\Windows\v7.0A\Include

C:\ProgramFiles\Microsoft Visual Studio x\VC\Include

...


And your Visual C++ library search path should look like this:


C:\ProgramFiles\Debugging Tools for Windows (x86)\sdk\lib\i386

C:\ProgramFiles\Microsoft SDKs\Windows\v7.0A\Lib

C:\ProgramFiles\Microsoft Visual Studio x\VC\Lib

...


In the above examples, "x" could be "8", "9.0",or "10.0" (or possibly other values) depending on which version ofVisual Studio you have installed. Also, the name of your
 MicrosoftWindows SDK directory will probably be differentfrom the example depending on which version of the Platform SDK you haveinstalled.

Once you have completed all of the above steps, your build environment shouldbe ready. To build VLD, just open the
 vld.sln solution fileand do a full build.

Executing Your Built vld.dll

When actually running the built project, vld.dll will expect to find the DebugHelp Library as a private assembly. The private assembly must be located in thesame directory as vld.dll (either the Release or Debug directory by default).Otherwise, when VLD is loaded, an error message will pop up indicating that theprogram failed to initialize, and you will see a message similar to thefollowing in the debugger's output window:


LDR: LdrpWalkImportDescriptor() failed toprobe C:\Projects\vld\Release\vld.dll for its manifest, ntstatus 0xc0150002

To ensure that vld.dll finds therequired private assembly, you need to copy dbghelp.dll andMicrosoft.DTfW.DHL.manifest to the samedirectory that vld.dll is in.

Last edited Apr 5,2011 at 6:52 AM by KindDragon, version4

comments

polomora Nov 8 at 10:35PM 

[Update]
We have upgraded from VS2008 to VS2012.
When our application is executed with VLD switched on (via vld.ini), thestartup time increases from about five seconds (VS2008) to about one minute(VS2012). Likewise, the shutdown time increases from about two minutes (VS2008)to about 30 minutes (VS2012)

polomora Jul 31 at 5:30PM 

" To build VLD, just open thevld.sln solution file and do a full build."
The documentation states that Visual Studio 2010/2012 is supported for VLDdevelopment. However, there is no vld.sln included with the source codepackage.

Note that for those using an older version of Visual Studio, Visual StudioProject Converter claims to be able to downgrade the sln file to an earlierversion:
https://vsprojectconverter.codeplex.com/

 

 

Frequently Asked Questions


When I try to compile my program with VLD, it fails and the compiler gives thiserror:
 Cannot open include file: 'vld.h': No such file ordirectory.

The compiler can't find the header filethat VLD installed. This probably means that VLD's include subdirectory has notbeen added to the Visual C++ include search path. See the section above aboutUsing Visual Leak Detector for instructions on how to add VLD's directories tothe search path.

In the memory leak report, the callstackcontains many lines that say "File and line number unvailable" or"Function name unavailable". 

This may mean that VLD couldn't find thesymbol database for your program. The symbol database is ususally in a filenamed my-program-name.pdb. If this file is not located in the same directory asthe program itself, then VLD will probably not find it and can't show any fileor function names.

Last edited Apr 5,2011 at 6:55 AM by KindDragon, version2

comments

mikefulton Jan4 at 10:04 PM 

My symbol database file is in the samefile as the program file, but I'm still getting the error messages.

The FAQ item says... it "may" mean that it can't find the PDB file.What are the other possibilities?


Known Restrictions


Known restrictions/limitations in this version of VLD include:

·        Memory allocations made through calls to functions loadedfrom a DLL using delayed loading may not be detected.

·        Support for programs that use MFC 7.0 or MFC 7.1 is notcomplete yet. Some memory leaks from such MFC-based programs may not bedetected. A possible workaround for this restriction is to try forcefullyincluding the MFC DLLs in memory leak detection, by setting theForceIncludeModules configuration option to: "mfc70d.dll mfc71d.dll"and explicitly adding vld.lib as an input file on the linker command line (canbe added through project settings by adding it to the list of library modulesin the linker options). This restriction does not apply to programs that useMFC 4.2, MFC 8.0, MFC 9.0, or MFC 10.0, which are all fully supported.

·        Visual Leak Detector may report leaks internal to VisualLeak Detector if the main thread of the process terminates while other threadsare still running.

·        If more than one copy of the same C Runtime DLL is loadedin the process at the same time, then some leaks may go undetected (note thatloading more than one copy of the C Runtime DLL at the same time is probably abad idea to begin with).

Last edited Today at1:34 AM by KindDragon, version4

comments

Contributing


I encourage developers who've added their own features, or fixed bugs they'vefound, to contribute to the project. The full version-controlled source tree isavailable at this site.
 

GitHub Mirror:
 https://github.com/KindDragon/vld

Last edited Oct 18,2012 at 2:12 AM by KindDragon, version3

comments

No comments yet.

License


Visual Leak Detector is distributed under the terms of the
 GNU Lesser General Public License (LGPL). Thislicense allows you to use the VLD library with your own programs withoutrestriction. However, if you build a program (or another library) that is basedon the VLD source code, or uses parts of the VLD source code in it, then somerestrictions will apply. What this means is that you are free to ship and usethe distributed version of the VLD DLL with regular commercial programs. But ifyou create a modified version of VLD, that modified version must remain"free software". See the COPYING.txt file for details.

The Debug Help Library (dbghelp.dll) distributed with this software are notpart of Visual Leak Detector and are not covered under the terms of the GNULesser General Public License. They are separately copyrighted works ofMicrosoft Corporation. Microsoft reserves all its rights to its copyrights inthe Debug Help Library and Microsoft C Runtime Library. Neither your use of theVisual Leak Detector software, nor your license under the GNU Lesser GeneralPublic license grant you any rights to use the Debug Help Library or MicrosoftC Runtime Library in
 ANY WAY (for example,redistributing them) that would infringe upon Microsoft Corporation's copyrightin the Debug Help Library or Microsoft C Runtime Library.

NO WARRANTY

BECAUSE VISUAL LEAK DETECTOR ("THE SOFTWARE") IS LICENSED FREE OFCHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BYAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERSAND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OFANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THEENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU.SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARYSERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANYCOPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THESOFTWARE AS PERMITTED BY THE LICENSING TERMS SET FORTH ABOVE, BE LIABLE TO YOUFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIALDAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUTNOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSESSUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITHANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES.

Last edited Oct 18,2012 at 2:11 AM by KindDragon, version4

comments

No comments yet.

Additional Developers Wanted


This project is looking for additional developers who have the time, knowledge,and talent, to help make VLD continue to be a useful utility for the Windowsdeveloper community. If you feel that you, than you fix bugs or implement newfeatures and create pull request to project.

Last edited Oct 18,2012 at 2:10 AM by KindDragon, version3

comments

mmosquito Sep 7, 2011 at12:49 AM 

How about dump Block id Descending justas _crtDumpMemoryLeaks

Sign in toadd a comment

 

 类似资料:

相关阅读

相关文章

相关问答