How I can detect memory leaks of C++ application in Linux (Ubuntu OS)?

How I can detect memory leaks of C++ application in Linux (Ubuntu OS) ? What is the program you can advise me for this goal ?

Answers


Check out Valgrind, it should be in the Ubuntu repository. it can give you detailed information about memory usage in C++ programs. Kind of like a debugger for memory usage.

valgrind --tool=memcheck <your_app> <your_apps_params>

Use Valgrind for that purpose.


also may look ccmalloc, NJAMD, mpatrol, YAMD, LeakTracer


If open source software isn't mandatory you could also check out Purify


Need Your Help

Removing trailing newline character from fgets() input

c string gcc newline fgets

I am trying to get some data from the user and send it to another function in gcc. The code is something like this.