Hello,
I’m running a very simple ROOT macro from the interpreter (.L macro.C, macro()). My code looks like that:
void macro()
{
TFile *f[100];
f[0] = new TFile("file0.root");
f[1] = new TFile("file1.root");
....
f[99] = new TFile("file99.root");
....
(create one empty histo, and add one histo from each file to it)
....
for(unsigned a=100; a>0; --a)
{
delete f[a-1];
}
delete[] f;
}
Clearly opening 100 30MB files takes up a lot of memory, and indeed ROOT memory usage gros to 2GB or so, but it doesn’t reduce even though I use some delete statements. I can run the macro two or three times, but then ROOT will run out of memory and exit.
The question is, why is that so? The delete statements should free up memory, shouldn’t they?
I’m using ROOT v4.04.02b.
Thanks,
T.