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

From: OKUMURA, Akira <oxon_at_icrr.u-tokyo.ac.jp>
Date: Wed, 19 Sep 2007 11:23:47 -1000


Hello Valeriy,

I compiled ROOT 5.17.02 with the modified "draw.c" but it does not solve this problem. I would like to stress that memory leaks happen only when I call the program using /sbin/service command. If I run the program from a terminal command line, it keeps running properly.

Did you run the daemon on SLC4? If so I will replace my SL4.4 PC to SLC4. $ uname -a
Linux localhost.localdomain 2.6.9-55.0.2.EL #1 Tue Jun 26 10:46:04 CDT 2007 i686 i686 i386 GNU/Linux

$ gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --enable-shared --enable-threads=posix -- disable-checking --with-system-zlib --enable-__cxa_atexit --disable- libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)

$ root -config
ROOT ./configure options:

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 - 23:25:22 CEST

This archive was generated by hypermail 2.2.0 : Sun Sep 23 2007 - 23:50:02 CEST