Hi,
Is there a way to print the leak info while the program is being run.
For the following program, Leak summary is printed only when the program exits.
I want to check mem leaks in the daemon program in linux.
#include <iostream>
class Tmp {
private :
char *x;
public:
Tmp () {
x = new char(100);
printf ( "In Tmp Constructor") ;
}
~Tmp () {
}
};
int main ()
{
Tmp t;
int i =5;
while (1) {
Tmp T;
sleep(2);
i--;
if (i==0) break;
}
sleep (2);
return 0;
}
Thanks
Raghav
|
|
From: Dan K. <da...@ke...> - 2010-01-22 21:48:59
|
<Rag...@on...> wrote: > Is there a way to print the leak info while the program is being run. Yes, see http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs |
Hi Dan, Can you pls explain . I am new to valgrind. How can I get tehe leakinfo. Thx Raghav -----Original Message----- From: dan...@gm... [mailto:dan...@gm...] On Behalf Of Dan Kegel Sent: Friday, January 22, 2010 4:49 PM To: Raghavendra Uppalapati Cc: val...@li... Subject: Re: [Valgrind-users] Leak info while Running <Rag...@on...> wrote: > Is there a way to print the leak info while the program is being run. Yes, see http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs |
|
From: Dan K. <da...@ke...> - 2010-01-23 04:34:18
|
On Fri, Jan 22, 2010 at 1:55 PM, Raghavendra Uppalapati <Rag...@on...> wrote: >> http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs > Can you pls explain . I am new to valgrind. How can I get tehe leakinfo. Um, sure. Try http://stackoverflow.com/questions/1001448/using-cppunit-for-memory-leak-detection that spells it out better. |