
-----------------------------------
HazySmoke)345
Mon Jan 08, 2007 4:52 pm

How can you tell if there is a memory leak?
-----------------------------------
Besides the fact that you can try to run your program 1000 times and see if it crashes, is there actually a way to figure out whether there's memory allocated by malloc() that hasn't been freed? Thanks.

-----------------------------------
md
Mon Jan 08, 2007 5:10 pm

RE:How can you tell if there is a memory leak?
-----------------------------------
Yes, using other libraries and tools; what they are called I do not know. You can also try writing your own malloc wrapper that counts allocations and deallocations; then you could get current memory usage.

-----------------------------------
Null
Tue Jan 09, 2007 9:08 pm

RE:How can you tell if there is a memory leak?
-----------------------------------
Or you could use tools such as valgrind.

It will report memory leaks and segfaults and where they occur.

-----------------------------------
r.3volved
Tue Jan 09, 2007 9:59 pm

RE:How can you tell if there is a memory leak?
-----------------------------------
I use the boost library
It's auto unit test helps me out a lot

-----------------------------------
HazySmoke)345
Wed Jan 10, 2007 12:25 am

Re: How can you tell if there is a memory leak?
-----------------------------------
Thanks guys, I'll try and see if I can work with them.
