piberger / Xbb

New repository for VHbb plus other Xbb analyses
0 stars 8 forks source link

Actually Fixed Memory Leak #129

Closed dabercro closed 4 years ago

dabercro commented 4 years ago

Following the clues in #128 I ended up putting a printout in the fit constraint destructor and putting del statements all over the place. del stopped working after fitter.addConstraint() https://github.com/piberger/Xbb/blob/master/python/myutils/kinFitterXbb.py#L274

I think what was actually happening is Python or ROOT gave ownership of the constraints to the fitter. Deleting the Python proxy for the constraints wasn't enough. The fix was to explicitly delete constraints in the fitter's destructor.

dabercro commented 4 years ago

So with this change some of the longer jobs used up to 2 GB of memory, but the nodes on the MIT cluster is able to handle those (barely).

piberger commented 4 years ago

nice, thanks! 2GB is also ok for us, I'll merge it into the master

dabercro commented 4 years ago

@capalmer85 I'm not sure if AnalysisTools has the same ownership problem or not when running the Kinematic Fitter. This change might be worth making for you too.

capalmer85 commented 4 years ago

Good to know. I'll look into it. Thanks!