Archived

This topic is now archived and is closed to further replies.

JaZsT

Fighting memory leaks.....

Recommended Posts

Hello everybody I wonder what is the best way to fight memory leaks....?? I guess using programs like Purify, or BoundsChecker, right????? The problem is that these 2 programs are very expensive, and it is allmost impossible to get a cracked version, only to test and evaluate them... So does anyone have or know where to get a crack or demo version of these programs??? What about other similar tools, or solutions ??? Any suggestions?? Thanx in advance -- Uros Life lived unexplored is life not worth living !

Share this post


Link to post
Share on other sites
Why not try using smart pointers for most of your objects?

With smart pointers you can basically instantiate an object and just forget about it. The smart pointer will handle deleting it when there are no more references to it. I''m sure there''s some overhead, especially with overloading the -> operator, but it shouldn''t make a big deal.

Share this post


Link to post
Share on other sites
1) Use java (yeah right)
2) Read the great article on flipcode about leaks - they overload new and delete operator too keep track of mem allocations - but they do this only in the debug build, so there''s still no overhead in the release build
3) Search for ''bugslayer'' in the MSDN, there are some nice articles.

Share this post


Link to post
Share on other sites