I have used Totalview’s Memoryscape to do some memory leaks checks and I have “none”, well at least none on the HEAP….but it seems tools like MemoryScape only check the heap, not stack leaks…
I have noticed a small leak occurring on AIX and Solaris (any maybe Linux, still checking)….and am trying to hunt it down.
I do use a single (joinable) thread in my application that does all the work…
Please bear with me, C is not my day job 😉 but I have 2 questions:
-
If I spawn an POSIX thread and it does malloc’s etc…are these on the heap or on the threads stack? Would a memory checking (heap) tool typically also find leaks when a thread does not free a malloc?
-
What tools would you recommend to use to find leaks on the STACK? I have used “libumem” on Solaris but not sure if that is finding what I need..
Can I perhaps use VALGRIND on Linux to check for leaks on my thread’s stack?
Thanks for the help 😉
Lynton
Everything you get via
malloc, no matter where you call it is from the heap. A memory debugger should be able to catch leaks. Valgrind is a good tool to find leaks, it should work well with threads.