Solved

How to use mtrace to detect memory leaks

Posted on 2006-11-16
4
713 Views
Last Modified: 2012-06-21
Hi,

I want to see if my application has any memoryleak.  Is there any tools that I can use? I found references to mtrace on web.  But, It seems it is not installed on my Linux system...??

-bash: mtrace: command not found

Thanks,
0
Comment
Question by:ambuli
  • 3
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 17962292
The most widely used tool is IMO 'dmalloc' (download plus docs: http://dmalloc.com/), see http://www.linuxjournal.com/article/6556 ("Memory Leak Detection in C++") for alternatives and general info on this issue.
0
 

Author Comment

by:ambuli
ID: 17962346
Hi JKR.  My System is Centos.  I am not sure if I can downloadthe rpm for redhat and install it.  By the way, mtrace seems to be included in glibc...  So, where is it installed on a system?

Thanks
0
 
LVL 86

Expert Comment

by:jkr
ID: 17962386
Smalloc comes as source and in not just installed on your system. No need to download an RPM, the code is available via http://download.sourceforge.net/dmalloc/dmalloc-5.4.2.tgz - you need to compile that and link your application with it.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 17962404
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question