PyROOT loop over files, huge memory leak

Hi Enric,

this is a working minimal reporducer:

#!/usr/bin/python

#Imports
from ROOT import TFile, TFolder, TH1I

def process_file(f):
rootFile = TFile(f,“READ”)
histos_folder = rootFile.Get(“histos”)

#process histograms
#h = histos_folder.FindObjectAny(“hTriggerStats”)

#histos_folder.Clear() #doesnt help
#del histos_folder #doesnt help
rootFile.Close()

def main():
files = [‘his05000_Reanalysis_1.root’,‘his05001_Reanalysis_1.root’,‘his05002_Reanalysis_1.root’]0
for f in files:
process_file(f)

if name == “main”:
main()

This is a link to 3 input files:

[https://drive.google.com/open?id=1CUReKcz4v1h1YiwhTLN71XoqqZGLsqV7]

best

Frederik