Jump to content
  • Advertisement
Sign in to follow this  
the dodger uk

c++ memory leaks detection

This topic is 1994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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  

Share this post


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

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites
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 ;) Edited by Karsten_

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!