what are the ways to test for memory leaks?

as above? how do I find out if my program leaks memory?
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.
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.