How to reset ROOT's memory?


I’d like to know if there was another way than [color=orange]delete gDirectory->FindObject(“Object_name”);[/color] to reset ROOT’s memory ?

Thank you.

In fact, I have two macros, in which some arrays have the same name but not the same length. When I launch one macro after the other, I get this kind of error message :

And [color=orange]gDirectory->…[/color] doesn’t seem to work for arrays.

Any idea (but not just changing the arrays names…) ?


Hi Berder,
for unnamed macros only you can use gROOT->Reset() (see the chapter “Creating Objects on the Stack and Heap” in the Users’ Guide). But I’d advise you to compile your macros, using “.L mymacro.C+”.