Is there a way to track a programs memory usage so I can make sure I don't have a memory leak issue?
What I'm hoping for is some sort of function like mem_usage() or something that will return the amount of memory my program is using.
Is there a way to track a programs memory usage so I can make sure I don't have a memory leak issue?
What I'm hoping for is some sort of function like mem_usage() or something that will return the amount of memory my program is using.
There are tools like Valgrind and Purify that can perform such memory leak detection.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
If you're using Microsoft visual something-or-other, then read this
http://msdn.microsoft.com/en-us/library/bebs9zyz.aspx
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
lint only does static code analysis. if you use a library function where the source isn't available, lint can't tell you if the function allocated memory and you forgot free it. if it were that simple you could just write a macro wrapper around malloc and free to keep track of heap memory.
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.