Issues Delete()-ing RooFit objects with PyRoot

Hello ROOT & RooFit experts,

I’ve been having issues with pyROOT, running ROOT 6.22/02, python 3.6.8, and SL7.8. I’m not sure if the issue resulted from changes made in 6.22 or a previous version, the last root version I had installed where this was working was 6.16/04.

I have a program creating RooFit objects (RooRealVar, RooGenericPdf, RooArgList, RooAddPdf, and RooAbsReals) in a loop, and found that the memory usage of my program continued to rise with each loop iteration. What ultimately fixed this problem was issuing a:

del object

at the end of the loop for each created object. However, when I try issuing an object.Delete() in 6.22/02, I get a segmentation fault error. Commenting out those lines, and just leaving in the del object lines, I don’t get seg faults, but am back to the problem of large, growing memory usage.

I’m attempting to roll back to 6.16/04 now, but wanted to see if this was a known bug and if there are any other suggestions to try. Thanks!

Thanks - let’s see with the experts: @StephanH @etejedor is this a known side-effect of the new, automatic PyROOT / RooFit lifetime management? Can we capture the delete?

Hi @shedges,

can you post an example that we can run? You certainly should not have to manually del any objects, PyROOT should take care of that. Let’s try to fix this on the ROOT side, so you don’t need dels.

The segfault when combining object.Delete() and del object is probably due to a double delete. As Stephan said, there should be no need for explicit deletes, but we would need more information about the code you are running.

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