Sign in to follow this  
3dmodelerguy

Finding Memory Leaks

Recommended Posts

I was trying to follow a tutorial on using smart pointers and came to a problem. I want to test my code with and without the auto gc but when i run code that i know that has a memory leak my debug console window does not show it like that tutorials says. Is there an easy way to find out if my program in having a memory leak?

Share this post


Link to post
Share on other sites
If you're using visual studio use: _CrtDumpMemoryLeaks() or _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ). Some additional information regarding tracking memory leaks with Visual Studio is here.

There are other tools available as well:

purify

or

valgrind

Basically, not matter what major platform you're on, something will be available.

Share this post


Link to post
Share on other sites
Quote:
Original post by fpsgamer
If you're using visual studio use: _CrtDumpMemoryLeaks() or _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ). Some additional information regarding tracking memory leaks with Visual Studio is here.

There are other tools available as well:

purify

or

valgrind

Basically, not matter what major platform you're on, something will be available.



are these all pertaining to .NET? or will these work with native C++?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this