Re: again ROOT db (long) (fwd)

Rene Brun (Rene.Brun@cern.ch)
Thu, 02 Apr 1998 16:00:26 +0200


Christoph Borgmeier wrote:
>
> sorry, if this appears twice somewhere. It is a reply on a Rene Brun mail.
>
> ---------- Forwarded message ----------
> Date: Wed, 1 Apr 1998 14:51:29 +0200
> From: Christoph Borgmeier <borg@hera-b.desy.de>
> Newsgroups: cern.root
> Subject: Re: again ROOT db (long)
>
> Hi Rene,
>
> thank you for the detailed answer. I understand now a lot more than
> before, esp. about the fact, that there cannot be cross-links between two
> branches.

this is the case in split mode. However, even in this mode as pointed by
Pasha, it is trivial to provide cross-references using indices.
In theory pointers (or smart pointers) are nice. In practice, if
you want to save disk space, indices have a lot of advantages.

>
> I have also tried the feature of avoiding multiple versions of the same
> object in a file. But I still ran into the problem of memory leaks. The
> additional objects are neither reused nor deleted when reading the next
> event. The effect might be neglectable in case of TCanvases, but in my
> event example I get ~80MB of memory leaks when reading an event sample.
> That means, although everything else is working fine, I have to restart
> ROOT every time I want to restart my loop macro.
>
> As mentioned in my previous posting, I tried already to build my own
> garbage collection but failed so far. Could the ROOT garbage collection
> classes be of any use?
>

My suspicion is that you have a problem with your destructors.
Any object allocated by a constructor ,added to a list, things such
float *x, etc must be deallocated in your destructors.
A good way to look at memory leaks for objects is to use the
statement:
gObjecttable->Print();
after every event and see how the list of objects grows.
However this statement cannot spot leaks coming from the allocation
of arrays of basic types.

Rene Brun