4

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 4

8

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.

7
  • i think valgrind can only be used on LINUX .not on HPUX or AIX which have no GUI.
    – Vijay
    Commented 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)
    – Glen
    Commented 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
    – Glen
    Commented Mar 4, 2011 at 15:04
  • valgrind's supported platforms are listed here: valgrind.org/info/platforms.html
    – Cubbi
    Commented Mar 4, 2011 at 15:06
  • @wvwvwv I've added some AIX and HP compatible products
    – Glen
    Commented Mar 4, 2011 at 15:51
1

I use Insure and it works well. For more information use http://www.parasoft.com/jsp/products/article.jsp?articleId=530

0

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.

0

I also use this tool regularly and it has solved many problems for me instantly. This is one tool which I have created for identifying memory leaks in solaris unix. Here it is. The way to run it also mentioned here clearly.

Not the answer you're looking for? Browse other questions tagged or ask your own question.