c++ memory leaks detection

Started by
15 comments, last by brx 11 years, 2 months ago

is there any good programs that detect memory leaks and can point you in the right direction

i need a really good one , not even mind paying real money to buy a professional software that can do it

Advertisement
For what platform/compiler? Some compilers have built in functionality for this (ex: MSVC's crtdbg.h header contains leak detection functions).

To expand a little on SiCrane's response:

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

And when running MinGW on Windows, you're out of luck for free options as far as I've looked. sad.png

There is also IBM Rational Purify which supports GCC on Linux and Microsoft Visual C++ on Windows.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
There's also www.drmemory.org, which is similar to valgrind but also works on windows.

sorry , its for windows and c++ , and not .net

its a big project and memory leaks are killing it after a bit , just trying to track down the source

Are you using smart pointers such as std::auto_ptr or std::tr1::shared_ptr?

These will help prevent almost all memory leak issues and really are the way to go in modern C++. Afterall, prevention is better than cure ;)
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

I am using this one: http://vld.codeplex.com/

Are you using smart pointers such as std::auto_ptr or std::tr1::shared_ptr?

These will help prevent almost all memory leak issues and really are the way to go in modern C++. Afterall, prevention is better than cure ;)

std::auto_ptr was designed badly and has been deprecated. It was designed badly because they were trying to add the features that std::unique_ptr has, before they had the actual capabilities (move semantics) to do so properly, so they worked around the problem instead of fixing the problem (the problem being a difficult and huge change, but one they successfully made in C++11). One side effect of 'working around' the problem is std::auto_ptr can't be used in most standard library containers. ohmy.png

This topic is closed to new replies.

Advertisement