Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 302
G-71 Avatar asked Mar 19 '11 06:03

G-71


People also ask

How do I find memory leaks in Ubuntu?

If you're concerned about a memory leak, try typing free repeatedly into a terminal. If you suddenly start to see RAM use quickly growing, then you've already detected a memory leak.

How do I check for memory leaks on my application?

To find a memory leak, you've got to look at the system's RAM usage. This can be accomplished in Windows by using the Resource Monitor. In Windows 11/10/8.1: Press Windows+R to open the Run dialog; enter "resmon" and click OK.

Which tool gives the information about memory leak in C program?

In this article, you can learn how to find memory leaks in C and C++ applications with the help of a runtime error detection tool.


2 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> 
like image 104
Cody Avatar answered Oct 10 '22 11:10

Cody


Use Valgrind for that purpose.

like image 43
jonsca Avatar answered Oct 10 '22 09:10

jonsca