问题
In Linux, I have been using valgrind for checking if there are memory leaks in an application. What is the equivalent in Windows? Can this be done with Visual Studio 2010?
回答1:
How about Visual Leak Detector? It's not inbuild, but I do think it's the most popular one.
回答2:
C++ Memory Validator finds memory and handle leaks in native Windows programs built with Visual Studio, Delphi and other compilers. Fast and can handle large workloads (some users track several billion allocations and deallocations in one run).
Disclosure: I'm the designer of C++ Memory Validator. We built it because other tools couldn't handle the workload when we were working with SolidWorks R&D Ltd.
回答3:
Dr. Memory is a memory monitoring tool capable of identifying memory-related programming errors such as accesses of uninitialized memory, accesses to unaddressable memory (including outside of allocated heap units and heap underflow and overflow), accesses to freed memory, double frees, memory leaks, and (on Windows) handle leaks, GDI API usage errors, and accesses to un-reserved thread local storage slots.
Dr. Memory operates on unmodified application binaries running on Windows, Linux, Mac, or Android on commodity IA-32, AMD64, and ARM hardware.
Dr. Memory is built on the DynamoRIO dynamic instrumentation tool platform.
回答4:
You can use DevPartner tool for finding memory leaks in C++ applications using visual studio.
回答5:
Visual Studio 2015 and later versions have Native Memory Leak Diagnostic Tool, check this for details: https://dzone.com/articles/native-memory-leak-diagnostics.
来源:https://stackoverflow.com/questions/4790564/finding-memory-leaks-in-a-c-application-with-visual-studio