Re: Memory leak of TCanvas->SaveAs in a daemon process

From: OKUMURA, Akira <oxon_at_icrr.u-tokyo.ac.jp>
Date: Tue, 18 Sep 2007 21:21:23 -1000


Hello Valeriy

Sorry but I forgot to write about the ROOT version. I compiled ROOT 5.16.00 without any configure options on SL 4.4 (32 bit). But I replaced draw.c in libAfterImage to a modified version (see thread "ImageDump error (2)" in Feb 2007).

If I run the program from a terminal command line, $ ./test2
memory leaks do not happen. I do not know why memory leaks happen only when I use the daemon() function in /etc/init.d/functions.

BTW, your modification in clip_line() in draw.c seems to be removed in recent versions...

Sincerely

OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan Phone/Fax : +81 4-7136-3153
Skype : okumura.akira

On 2007/09/18, at 19:00, Valeri Onuchin wrote:

> Hi Akira,
> what is the ROOT version? I do not see mem.leaks
> against CVS ROOT. We have fixed some mem.leak
> in TImage recently (probably it's related to your case).
>
> Regards. Valeriy
>
>
>
> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch on behalf of Valeri Onuchin
> Sent: Wed 9/19/2007 6:57 AM
> To: OKUMURA, Akira; roottalk (Mailing list discussing all aspects
> of the ROOT system)
> Subject: RE: [ROOT] Memory leak of TCanvas->SaveAs in a daemon process
>
> Hi Akira,
> oopps, sorry. I didn't notice that image deleted by "array.Delete();"
>
> Regards. Valeriy
>
> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch on behalf of OKUMURA, Akira
> Sent: Tue 9/18/2007 10:43 PM
> To: roottalk (Mailing list discussing all aspects of the ROOT system)
> Subject: [ROOT] Memory leak of TCanvas->SaveAs in a daemon process
>
> Hello ROOTers,
>
> The line
> 56: can->SaveAs("tmp.png");
> in "test2.cxx" causes a memory leak if I run the program as a daemon
> process on SL 4.4. You can see that heap memories are deleted in the
> end of while loop in the code. But memory leaks happen.
>
> $ cd /home/foo
> $ ls
> testd test2.cxx
> $ g++ -c -o test2.o test2.cxx `root-config --cflags`
> $ g++ -o test2 test2.o `root-config --glibss`
> $ su
> # mv testd /etc/init.d
> # /sbin/service testd start
> Starting test2: [ OK ]
> # exit
> $ PID=`pgrep test2` top -p $PID
>
> You will see the used memory increase. How can I eliminate this
> problem?
>
> Sincerely
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Phone/Fax : +81 4-7136-3153
> Skype : okumura.akira
>
>
>
Received on Wed Sep 19 2007 - 09:22:14 CEST

This archive was generated by hypermail 2.2.0 : Wed Sep 19 2007 - 23:50:01 CEST