Minuit2Minimizer - Migrad memory usage

During a minimization of a 1000-variables function,

after 2000 iterations
the memory usage of Minuit2Minimizer (kMigrad) is like 10 GB.

Is this expected?
(ROOT 5.34.01)

I passed a GRADFUNCTOR as input by using SetFunction.


Ok I have understood the problem.

Is there a real need to store “result” of each iteration in memory?

In VariableMetricBuilder.cxx there is a line
result.push_back(MinimumState(p, e, g, edm ,fcn.NumOfCalls())

After this line I have added
if (result.size()>128) { result.erase(result.begin()+0);
to preverse only last 127 results.

Now the memory usage is 0.

Is this enough?
Please explain, is there a real need to store in memory the results for all the iterations?

Now I’m using an hacked version of minuit!



Probably preserving only few of the last state is enough. I will add an option to do it in the next version.
Thanks for the suggestion,