0

I am seeking for an application that could help me detect memory leaks in my C++ program. I am compiling using g++ over Ubuntu.

Is there such an application found on Ubuntu repository other than Valgrind cause it is not working for my case.

4 Answers4

1

four detecting memory leaks under linux you can use valgrind.

look at this link it contains some examples

Instead of valgrind you can use addresssanitizer.

Mauri
  • 1,185
  • 1
  • 13
  • 21
1

There are so many options.

But a typical one for linux systems would be valgrind. It is a dynamic memory analyzer.

It is very easy to use. The basic idea is that you call valgrind and let it fork the application to be debugged. Valgrind replaces standard library calls with some own wrappers, which allows it to track memory allocations and deallocations. If the application cancels you get an summary about your memory consumption and detailed listing about memory leaks.

Maybe you should note that a complex application could take some time to start up inside the memory debugger and could also run very slowly.

exilit
  • 1,156
  • 11
  • 23
0

Use ld_preload. Something like this:

https://github.com/jrfonseca/memtrail

liorda
  • 1,552
  • 2
  • 15
  • 38
0

Maybe this wikipage looks useful for you:

Memory_debugger

I never use this kind of program before, and I have Windows, so i don't know which is good, but maybe you found one.

Bady
  • 56
  • 8