[EMAIL PROTECTED] wrote:
> Hi, how do I trace if there is a mem leak in an app?
> any tool for this except ps, vmstat, top....
printf()'s, code reviews and a good source-level debugger. Stick a
printf() everywhere you do a malloc or free ;-). As for more
sophisticated/automated tools, I just recently discovered GNU Checker
(checkergcc). Haven't had a chance to use it yet, though. Looks like it
requires a recompile. Then there's ElectricFence, which just requires
that you link with -lefence.
There are commercial products like Purify and BoundsChecker (though I
think BC only runs on Windows). There are also some other malloc()
replacements, some diagnostic libraries that you can pre-load if you
don't have source, etc.
Then again, sometimes all you have is strace/truss and you have to count
sbrk's...
Brian
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]