Macro is using too much RAM

Hello all,

I wrote a macro for plotting histogram (CompareAdvanced.C (3.51 KB)). And I am calling it with another file named Plot_lhe.C (10.6 KB). But the problem is that as the code runs then my full 10GB RAM is used along with 5GB of swap space.

So, I think there is a problem of memory because I am not deleting the histogram that I am creating. But before saving I can’t delete those histogram but after reading that I am in different macro. So, I am confused that how could I remove this problem.

Please suggest what should I do.

Thanks & regards,

Try the attached file (just some small “brutal fixes” are added, but maybe they will be sufficient).
See also the “# Variable argument:” section in the “Limitation of CINT” document.
CompareAdvanced.C (3.73 KB)

Thanks Coyote. It worked.

Also, Thanks for the link about variable argument.