Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Clarified
-
6.13/01
-
None
-
None
-
Linux
Description
The following code that reads a folder stored in a ROOT file:
void process_file(const char* fname) { |
TFile rootFile(fname, "READ"); |
TFolder *histos_folder;
|
rootFile.GetObject("histos", histos_folder); |
rootFile.Close();
|
|
// delete histos_folder; // this does not solve the issue |
}
|
|
void test() { |
for ( auto &s : { "his05000_Reanalysis_1.root", "his05001_Reanalysis_1.root", "his05002_Reanalysis_1.root" }) { |
process_file(s);
|
}
|
}
|
leads to a memory leak. Explicitly deleting the TFolder object does not make a difference.
The 3 input data files can be found here:
https://drive.google.com/open?id=1CUReKcz4v1h1YiwhTLN71XoqqZGLsqV7
This was reported here:
https://root-forum.cern.ch/t/pyroot-loop-over-files-huge-memory-leak/28028/3