Possible side-effects when closing TFile

Dear ROOT experts,

I have a piece of code that generates a TFile containing O(100) TDirectories. Each directory contains many histograms, so that the TFile in the end contains O(100k) histograms and is roughly 100MB large.
When I am done filling the histogram I close the file with:


This takes a very long time. If I instead do:


It finishes rapidly. My question is if this second method has negative side effects, such as memory leak etc. Also, are there other ways to properly close the file without taking such a long time?

Looking forward to your response! Kind regards,
Peter Meiring

_ROOT Version:_ROOT 6.12/07
Platform: SLC6
Compiler: gcc (GCC) 7.3.1 20180127

1 Like

Dear Peter,

@pcanal probably knows what to do. Philippe, could you recommend what to do?


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.