Opened 5 months ago
Memory leak with GHep Ntuples with ROOT6
|Reported by:||sdennis||Owned by:||candreop|
First reported by Julia Y, noticed in gevscan in the validation builds - looping over one of the TTrees of GHepRecords leaks memory quickly.
This can be fixed in a manual loop by calling NtpMCEventRecord::Clear(), but it's not clear why this is necessary. Other, more automated loops (like TTree::Draw() ) are not possible while this bug continues.
There is a line in NtpWriter which seems related: fEventBranch->SetAutoDelete(kFALSE);
Setting this to true calls explicitly the destructors of the tree members, and appears to reduce the amount of memory leaked (for example, the Interaction objects are no longer leaked). However, most of the damage still occurs, which I think is related to the TClonesArray that GHepRecord inherits from.