Unix Technical Forum

Valgrind memory leak summary on demand

This is a discussion on Valgrind memory leak summary on demand within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> So, shoot me, it is not a slackware question, not even a linux question. I guess it relates to ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 10:46 AM
elzacho
 
Posts: n/a
Default Valgrind memory leak summary on demand

So, shoot me, it is not a slackware question, not even a linux
question. I guess it relates to software that can run on slackware =).
I didn't see a good group to put it in and I like you slackware
people.

I want to detect a memory leak. Valgrind provides useful information
for detecting if one is present by listing the unreachable blocks at
termination in the "memory leak summary". It would be nice however to
issue a command that would provide this memory leak summary in the
middle of the program, maybe before and after suspect code. Any one
know how to do this?

Sample code:

int main(void)
{

while(1)
{
valgrind_leakcheck();

/* Do some shady stuff */

valgrind_leakcheck();
}

return 0;

}

Ofcourse, it is doubtful that a function would exist as valgrind is
like a VM not a library. Maybe there is a way to do this through a
valgrind lauched gdb seesion?

Any thoughts are appreciated,

Zach

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 10:46 AM
Joost Kremers
 
Posts: n/a
Default Re: Valgrind memory leak summary on demand

elzacho wrote:
> So, shoot me,


ok, if you insist...

READY

AIM

FIRE!

(always happy to oblige. ;-)

> it is not a slackware question, not even a linux
> question. I guess it relates to software that can run on slackware =).
> I didn't see a good group to put it in and I like you slackware
> people.


there are programming groups that would probably be more applicable, but in
this case, i think your best bet would be the valgrind mailing list:

<http://valgrind.org/support/mailing_lists.html>

HTH

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com