Hi Rooters,
I have a program that loops over the tree entries (~ millions) and applies some selections. One of these selection is the following:
if(!isPassed(energy, p1))
continue;
where the function is defined as follows:
bool isPassed(Double_t en, Double_t P1)
{
bool ret = false;
TF1 * f_low = new TF1("f_low","[0]/x+[1]",0., 300.);
f_low->SetParameters(2.64450e+07, 4.66029e+02);
if (P1 > f_low->Eval(en) )
ret = true;
delete f_low;
return ret;
}
I used bsub to submit the job and I got the following error:
TERM_MEMLIMIT: job killed after reaching LSF memory usage limit.
Exited with exit code 137.
As soon as I comment the line where the function is called, the program ends correctly. I don’t understand where the leak is and how to fix it.
Thanks for any help!
TF1 * f_low = new TF1("f_low","[0]/x+[1]",0., 300.);
inside the loop? It doesn’t look like it’s changing from iteration to iteration, maybe you can move it out? If not, maybe you can allocate memory for your TF1 in a stack and not in a heap?
It looks like both leaks have disappear. It has been removed 9 months ago in TFormula::HandleParamRanges(TString &formula) and thus is not present anymore in ROOT 6.18.
And, the memory issue in TFile::GetStreamerInfoListImpl(bool lookupSICache) has been adressed 2 years ago and is not present anymore in ROOT 6.16.