Memory leaking

Started by
6 comments, last by phear- 14 years, 7 months ago
Whats the best way to see if a game is leaking memory?
__________________________________________
Eugene Alfonso
GTP | Twitter | SFML | OS-Dev
Advertisement
Generally your compiler or standard library implementor will offer functionality to detect memory leaks in your program. Alternately, you can try third party tools like valgrind. See also Tools for static code analysis Dynamic code analysis.
I just realized I was a little too vague in my question... I'm using Visual Studio 2008 Pro, and im coding in C++. I looked at your link SiCrane for static code analysis and I got CppCheck and I apparently have no errors, but I was wondering if there was anyway to check with VS? or maybe an add-on for it? Thanks for the help so far.
__________________________________________
Eugene Alfonso
GTP | Twitter | SFML | OS-Dev
Here's an interesting idea: MSVS comes with something called documentation. Specifically an application called MSDN. If you didn't install that with Visual Studio, do so now. Fire that guy up and trying looking up "memory leaks" in the index.
I never installed MSDN, but thank you for the help.
http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx
__________________________________________
Eugene Alfonso
GTP | Twitter | SFML | OS-Dev
Quote:Original post by phear-
I never installed MSDN, but thank you for the help.
http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx


There is always http://www.codeproject.com/KB/applications/visualleakdetector.aspx its a lib and header file and will only be compiled into your debug executable. It outputs how much memory is leak, a call stack and a hex dump of the leaked memory.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

As above.

For large projects it may be worth considering writing your own memory manager. You will be able to collect a lot of information of when allocations and deallocations are happening and whats going wrong.

Theres an article here on game dev that goes through it.. cant seem to find it tho.
Thank you both for the replies :) Ill look into that link as well as look at making my own memory manager.
__________________________________________
Eugene Alfonso
GTP | Twitter | SFML | OS-Dev

This topic is closed to new replies.

Advertisement