Re: [ROOT] Help about memory leaks for CDF offline monitoring!

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Thu Sep 20 2001 - 11:06:12 MEST


Hi Stephane,

On Wed, 19 Sep 2001 20:35:02 -0500
Stephane Tourneur <tourneur@fnal.gov> wrote
concerning "[ROOT] Help about memory leaks for CDF offline monitoring!":
> Dear "rooters"!
> 
> I wrote the Root browser 'SiliBrowser' ...

I've found the use of TObjectList a very useful tool when hunting
down memory leaks.  Put gObjectList->Print() at stratigic places in
your code (such as after the creation of objects with "new", after
destruction with "delete", clearing of collections with
TCollection::Clear(), deletion of collections with
TCollection::Delete(), and so on).  Also read the chapter "Object
Ownership" in the ROOT Users Guide (I believe it's chapter 8), in
particular note the text on collections, the canvas and pads. 

When you've figured out where things go wrong, more or less, use GDB
to step through the code to find out more.  You may want to build ROOT
with debugging symbols; configure with option --build=debug.  Also
make sure that your code is compiled with debugging symbols and no
optimisation (GDB works with optimisation, but it's much easier to
debug the code if you don't use optimisation). 

If all of the above does not solve your problem, try to make a
minimalistic example that shows the problem, and submit that to
roottalk. 

Hope this helps you. 

Yours, 

Christian Holm Christensen -------------------------------------------
Address: Sankt Hansgade 23, 1. th.           Phone:  (+45) 35 35 96 91 
         DK-2200 Copenhagen N                Cell:   (+45) 28 82 16 23
         Denmark                             Office: (+45) 353  25 305 
Email:   cholm@nbi.dk                        Web:    www.nbi.dk/~cholm



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:00 MET