[Math] Fix memory leak when using GSLMultiFit and improve Fitter class#10439
[Math] Fix memory leak when using GSLMultiFit and improve Fitter class#10439lmoneta merged 3 commits intoroot-project:masterfrom
Conversation
…n functiona in the BasicMinimizer and their derived classes. Thia fixes the memory leak observed in the ROOT Forum. (See https://root-forum.cern.ch/t/gslmultifit-memory-leak-with-root-fitter/49566 )
Refactor some of the fitting code avoiding a Clone of the chi2 or likelihood function. Make better used of the shared pointer to the objective function
|
Starting build on |
| FitTransformFunction(const FitMethodFunction & f, MinimTransformFunction *transFunc ) : | ||
| FitMethodFunction( f.NDim(), f.NPoints() ), | ||
| fOwnTransformation(false), | ||
| fOwnTransformation(true), |
There was a problem hiding this comment.
PR look good to me, thanks for the improvements in the ownership model!
Now that you use smart pointers, can this fOwnTransformation member be removed?
There was a problem hiding this comment.
Thank you for the comment. I have now improved also that internal class and the data member is removed!
guitargeek
left a comment
There was a problem hiding this comment.
Thanks for the PR, I only have one request about the fOwnTransformation member.
Include comment of Jonas, and use now unique_ptr for managing the TransformFunction pointer. Remove also a constructor which was not used and was actually leaking memory.
|
Starting build on |
guitargeek
left a comment
There was a problem hiding this comment.
Thank you for the update, looks very good now!
|
Build failed on mac1015/python3. Errors:
|
A bug was introduced in root-project#10439 affecting the weighted likelihood fits
A bug was introduced in root-project#10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in #10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in root-project#10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in root-project#10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in #10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in #10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
A bug was introduced in root-project#10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
This Pull request fixes a memory leak reported in https://root-forum.cern.ch/t/gslmultifit-memory-leak-with-root-fitter/49566 when using GSLMultiFit.
In addition for fixing for the leak the handling of the internal transformation function is improved and an extra un-needed clone of the objective function in the Fitter class is avoided.