On the unix environment, are there any tools which can easily analyse the code and mention there is a chance of memory leakage in certain sections of the code. HPUX/AIX/Solaris
4 Answers
If you're talking about static analysis then there's cppcheck (among many others)
If you're talking about a runtime checker (which will be way more accurate and reliable than static analysis) there's valgrind
There's loads of other tools available. Check out the links above for more information
Purify will work on AIX (though it's not free.
HP has the wdb debugger, and it's capable of detecting memory leaks.
-
i think valgrind can only be used on LINUX .not on HPUX or AIX which have no GUI.– VijayCommented Mar 4, 2011 at 14:56
-
@wvwvwv, 2 points, 1, Hpux, Aix, etc, all support GUI's of one form or another. 2, valgrind is a command line tool (no gui)– GlenCommented Mar 4, 2011 at 15:01
-
@wvwvwv, you are correct about valgrind not supporting HPUX or AIX directly. You could try porting it yourself though this wouldn't be easy I suspect– GlenCommented Mar 4, 2011 at 15:04
-
valgrind's supported platforms are listed here: valgrind.org/info/platforms.html– CubbiCommented Mar 4, 2011 at 15:06
-
I use Insure and it works well. For more information use http://www.parasoft.com/jsp/products/article.jsp?articleId=530
Although not a specialized tool for detecting memory leaks another option is the Boehm-Demers-Weiser garbage collector available from HP Labs.
It works as a replacement for new and malloc.
Here are instructions to use it as a leak detector. It is, or was, used by Mozilla as a leak detector for Firefox. If i recall correctly it was also used by Mono and DotGNU Portable.NET as a gc.