Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-07-2004, 05:45 AM   #1
LQ Newbie
Registered: Jun 2004
Posts: 1

Rep: Reputation: 0
info required

Hi All,

I am an Validation Engineer, i need info on how to verify how to verify memory leak using Linux commands.

Is there any command or tool available in open source, so that i ca use to test memory leak.

Old 07-07-2004, 06:46 AM   #2
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You may find this article helpful. It is focused on memory leak detection on embedded systems but it should apply equally well to regular Linux systems.

Old 07-07-2004, 12:27 PM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
there is a tool called mtrace

modify source code to
#include <mcheck.h>

then invoke mtrace();
at the beginning of main.

export MALLOC_TRACE=memory.log
and run the programm

mtrace my_program $MALLOC_TRACE

also you can use the ccmalloc library as a replacement for malloc and free
as a way to trace mem allocation

also a tool called "Electric Fence"
you can link against that will stop at any bad read/write and tell you what happened
this is the only way i know of to find illegal reads so it's kind of important.
this one will do lots of different stuff by setting SHELL variables so read the manual.

Last edited by foo_bar_foo; 07-07-2004 at 12:29 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert an info file( to a single html file Darwish Linux - Software 2 09-24-2005 06:51 AM
Info Required for Turbo C++ compiler alix123 Programming 3 04-28-2005 10:17 AM
X is required Wolf-67 Linux - Newbie 6 10-02-2004 09:24 PM
Some help required. Dsavage Linux - Newbie 1 07-23-2004 08:50 PM
Osborne MAG15DLS monitor info required AshleyK Linux - Hardware 1 10-04-2003 11:48 PM

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration