Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to valgrind (memcheck) for finding leaks on linux? [closed]

I have a linux x86 application that makes use of various third-party shared-object libraries. I suspect these libraries are leaking memory (since it can't possibly be my code ;-)

I tried the trusty valgrind, but it died a horrible death because one of the third-party libraries is using an obscure x86 instruction that valgrind doesn't implement.

I found a recommendation for DUMA and gave it a try (using the LD_PRELOAD technique to bring DUMA in at run-time), but it aborted complaining about a free operation on memory that wasn't allocated via DUMA (almost certainly by some constructor of a static object in one of the previously mentioned third-party libraries).

Are there other run-time-linkable (or otherwise not requiring a recompilation/relink) tools around that will work on linux?

like image 513
jhfrontz Avatar asked Sep 14 '11 00:09

jhfrontz


People also ask

How do I find a memory leak without Valgrind?

In non-memory leak detection mode you pass through directly to malloc and free, and in memory leak detection mode you first log the alloc and free calls and then call through to malloc and free. When the program finishes you match up the allocations and frees, and you'll see where you're leaking memory.

What is the best tool to detect memory leaks?

Using Memory Profilers Memory profilers are tools that can monitor memory usage and help detect memory leaks in an application. Profilers can also help with analyzing how resources are allocated within an application, for example how much memory and CPU time is being used by each method.

Which tool is used for handling memory leak problem in Linux?

The most popular Valgrind tool is Memcheck, a memory-error detector that can detect issues such as memory leaks, invalid memory access, uses of undefined values and problems related to allocation and deallocation of heap memory.


1 Answers

Give Dr. Memory a try. It is based on DynamoRIO and shares many of the features with Valgrind.

like image 70
0xC0000022L Avatar answered Sep 30 '22 20:09

0xC0000022L