Skip to content

Possible memory leak while looping over func_coll.get_thor_functors().items()

I think there may be a memory leak with DecayTreeFitter when looping over func_coll.get_thor_functors().items()—looking at the pipeline output of AP MR !3318, I can see that the memory usage is huge and increasing over time.

In the Functions.py script it seems that the user is looping over func_coll.get_thor_functors().items(), creating a DecayTreeFitter instance and assigning it to the variable DTF in every iteration. My guess is that the DecayTreeFitter object holds internal references to large objects and it may retain some resources. I am not an expert and I am not sure this is the main cause of the high memory usage, but I have seen this problem in other AP MRs and it was solved by correcting the loops.