I am curious whether anyone else has noticed memory leaks while using Roofit. At first, I thought it was just the class I wrote (not deleting pointers). Anyone can try this at home, just fitTo() a simple gaussian hundreds of times, thousands even and watch the memory consumption grow. The memory consumption seems to grow even if all the pointers are deleted.
This is becoming a major problem in the analysis I’m working on, since I need to do thousands of fits.
I would like to investigate your problem in a bit more detail. RooFit was (once)
thoroughly debugged for memory leaks, but some of the recently added features
might misbehave.
It is quite easy to see which objects RooFit creates by activating the memory tracing
options. Before you execute any RooFit macro type ‘RooTrace::active(1)’, which
will activate memory tracing. At the end of your macro, a call to 'RooTrace::dump()'
will show what objects are left in memory.
Also, if you could send me a working example, I be able to see (and fix) more.
Here’s a macro that should illustrate the problem.
Increase the nfits argument to see increasing memory consumption.
The output of the memory tracing option mentioned in the last post is attached.
-Nathan