RooFit createProfile memory leak?

Hi,
I was trying out the createProfile function (the relevant lines are found below) and noticed that while the execution took a very long time (which was to be expected), the memory usage increased during execution to the point at which all RAM was used and the program had to be terminated. How can this be avoided? I saw that by adding the nll used to create the profile as an owned component this should be avoided (which it is at first), but after a while it still appears.

Is this a known issue? Is there a workaround?

Thanks,
Marco


Here’s how I use the command:
RooNLLVar NewNll = (RooNLLVar) simPdf.createNLL(combData,RooFit::ExternalConstraints(MyConstraint),RooFit::NumCPU(5));

RooAbsReal* MyProfile = NewNll->createProfile(mlledge);
MyProfile->addOwnedComponents(*NewNll);
(…)
MyProfile->plotOn(ProfFrame,RooFit::PrintEvalErrors(-1),RooFit::ShiftToZero(),RooFit::LineColor(TColor::GetColor("#656565")),RooFit::Precision(1e-3),RooFit::Name(“Profile”),RooFit::NumCPU(5));

the last line is the one causing the problem

pll_mlledge->addOwnedComponents(*NewNll);