How to use Visual Leak detector

Source: Internet
Author: User

Visual Leak detector is a free, robust, open-source Visual C + + memory leak detection system. Visual Leak detector can display a full memory allocation call stack that causes memory leaks, compared to the memory detection mechanism that comes with Visual C + +. Home Address: http://vld.codeplex.com/old version Address: http://www.codeproject.com/Articles/9815/ Visual-leak-detector-enhanced-memory-leak-detectio Download Visual Leak Detector, current version 2.2.3, "Tools" → "Options" → "project reconciliation in the Visual C + + IDE Solution "→" VC + + directory, "Include files" Increase VLD "\include" path, "library file" to increase the VLD "\lib\win32" path, in addition to the dynamic Library "\bin\win32" path has been added to the environment variables in the installation, if not added, You will need to manually copy the files under "\bin\win32" to the Project debug directory. The following records are used: 1. Create a new WIN32 console project; 2. Add the code as follows:
1
2
3
4
5
6
7
8
#include "stdafx.h"
#include "Vld.h"

int _tmain (int argc, _tchar* argv[])
{
Char *pbuf = new char[200];
return 0;
}
3. In debug mode, the Output window will have the following information:

The report lists the memory leaks that are in the number of blocks, where the address, the leaked bytes, the call stack, and the memory contents. Double-click the call stack to jump to the same row. 4. In release mode, Visual Leak Detector is not linked. 5.Visual Leak Detector There are some configuration items that can be set to save the memory leak report (file, debugger), copy "\visual Leak Detector" The Vld.ini file under the path is in the debug directory of the project (it needs to be copied to the project directory if it is running in the IDE), and the following items are modified: Reportfile =. \memory_leak_report.txt
Reportto = Both directly double-click the Debug directory EXE, as shown in the following: The contents of the file are the same as the contents of the Output window.

How to use Visual Leak detector

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.