How to do memory profiling in windows?

Possible duplicate:
Memory leak tool for C ++ on Windows

I was working on a Mac project, and I really liked that Xcode was its profiler. I found many errors just by running my program with various settings for this profiler. First of all, it will show me which parts of my program consume memory, it will show me if it has leaked into memory, and it will show me when it will be done. If I worked with a graphical interface, it would even show screenshots of what I did when these distributions / leaks / deallocations occurred.

I am currently working on a Windows / C ++ project using Visual Studio, and I suspect that the project is consuming too much memory and might also console some memory. Using Xcode, I simply run this profiler and immediately find out what is happening. In Visual Studio, however, I cannot find such a thing (there is a somewhat inconvenient performance profiler, but CPU time is not for me here).

So, how are you going to look for leaks and code with too much memory?

+4
source share
3 answers

See Application Verifier , LeakDiag, UMDH, and Debugging Tools for Windows in general.

All of them are free.

For more information on how to use them, see Advanced Windows Debugging .

+4
source

VS has no built-in memory profiling tool for unmanaged applications.

For other third-party tools, see this post: Is it possible to detect GDI leaks from the Visual Studio debugger?

+1
source

I would start using the Perfmon.exe tool (just type perfmon.exe at the command line). With this tool you can add counters, such as "Private bytes", "Number of processings", "Number of threads", etc. To profile your application over time.

There is information that can be extracted using this tool, and there is a lot of information about MSDN that describes how to use it, it not only limits memory leakage, it can compare I / O performance and other things as well.

Remember that for each type of counter you can include a brief description that will indicate the purpose of the counter (I think its value is turned off by default).

+1
source

All Articles