RooFit createProfile memory leak?

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?


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

RooAbsReal* MyProfile = NewNll->createProfile(mlledge);

the last line is the one causing the problem