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