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.
Printable View
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.
If you're using Microsoft visual something-or-other, then read this
http://msdn.microsoft.com/en-us/library/bebs9zyz.aspx
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.