📜 ⬆️ ⬇️

Memory Leaks in C ++: Visual Leak Detector

In this short note I want to talk about an excellent program for finding memory leaks under Visual Studio - Visual Leak Detector.
It is surprisingly easy to use and gives detailed information about the leaks found, but has not been mentioned on the habr.

Prehistory


Once I needed to look for memory leaks in one C ++ program, and the development environment was Visual Studio. The only thing I owned at the time about memory leaks was the C ++ CRT article on Habré, and I also knew the word Valgrind.

Unfortunately, I didn’t want to use C ++ CRT directly, to switch to Linux too (or to install a virtual machine / cygwin, etc.), and there was no time to understand Valgrind.

A short search produced an excellent wrapper over C ++ CRT - Visual Leak Detector.
')

Principle of operation


As I just said, essentially this is a wrapper over C ++ CRT.
You can read more on the code project . However, it should not be downloaded from there, because the site contains old versions abandoned by the original developer.

Where to download


You can download from codeplex or from Visual Studio Gallery .

Connection


There you can learn how to connect the search for leaks:
Install Visual Leak Detector on the computer, in any file we refer to vld.h: #include <vld.h>.

Work result


The program displays in the output window all the leaks, files and line numbers in which they occurred, as well as a stack of calls that led to the leak - what could be better.

Disclaimer


I have nothing to do with this product, I just want to share with the community a useful utility. It would be possible to limit it to a topic link, but you cannot insert links into it other than the original.

Source: https://habr.com/ru/post/113567/


All Articles