Finding memory leaks in a C++ application with Visual Studio

岁酱吖の 提交于 2019-11-27 10:32:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!