Hi, I have some questions about I/O of TObjArray containing TClonesArrays (The TObjArray is written in a branch of a TTree). The problem is similar to that described and solved here: a huge memory leak comes out when reading the TObjArray from the Root file. It seems connected to the TObjArray not owning the TClonesArray, and the fix is to properly SetOwner before wring the TObjArray or delete all the TClonesArray by calling TObjArray::Delete() in the readout event loop.
I am concerned about the performance of this approach: as far as I understand, using the solutions described above the TClonesArray buffer objects are deleted and instantiated again for each event with no memory reusage, so I think that the allocation/deallocatio overhead may be significant. Is this true? If so, is there a smart way to save a container of containers on a root file (maybe a TClonesArray of TClonesArrays instead of a TObjArray of TClonesArrays?) that might mitigate this problem?