what are the ways to test for memory leaks?

Feb 15, 2011 at 9:33am
as above? how do I find out if my program leaks memory?
Feb 15, 2011 at 11:16am
let the program run a 1000 times or even more, by using a while loop. This way, if there is a memory leak, the memory will slowly fill up and your program will fail. Cause it will eventually ask for free memory (RAM) while all is used by your program. That way you know there is a memory leak.
Feb 15, 2011 at 11:55am
Run it under valgrind, which will tell you upon ending how many bytes have been lost to memory leaks.
Topic archived. No new replies allowed.