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
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
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.
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.
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 use Insure and it works well. For more information use http://www.parasoft.com/jsp/products/article.jsp?articleId=530