B3tturTh3nU
B3tturTh3nU

Reputation: 163

C++ Memory Debugger?

Can anyone recommend a quality C++ memory debugging API or software for Windows(specifically, one that works with MinGW)? I'm nearly positive there's a memory leak in my program, but I have no idea where to start looking.

Also, on a related note, I previously tried overloading the global new and delete operators myself, and storing debugging information from there. Yet, when I try to replace every occurrence of new with my overloaded operator, it throws a bunch of errors. I only tried using a simple preprocessor macro to do so.

#define new new(__FILE__, __LINE__)

Is there any distinct way around that problem?

EDIT: I probably should have been clearer with this. I did in fact declare an overload, and implemented it without any errors. The only problem was when I tried using a macro to replace all uses of the new operator to use my overload instead, which is why I only posted the macro code.

Upvotes: 3

Views: 1295

Answers (1)

pepsi
pepsi

Reputation: 6875

For memory leaks in Windows, I've found that UMDH with usermode stack traces enabled is pretty useful. Here's a tutorial.

For a list of other tools, look here.

Upvotes: 3

Related Questions