ROOT not unloading files correctly?

Hi,
I’ve recently noticed that my RAM usage was increasing, even though I close all files after operations. I’ve attached a script (SampleLoadingProblem.C (2.07 KB)) that reflects this problem; for 30 local files, I see the following output:

At the very beginning: VM: 127260; RSS: 23692
After loading file 0 VM: 131792; RSS: 27380
(…)
After loading file 29 VM: 132196; RSS: 27792
After unloading file 0 VM: 132196; RSS: 27800
(…)
After unloading file 29 VM: 132196; RSS: 27800

so as you can see it increaes while loading files (no big surprise), but does not decrease when closing them. What am I doing wrong?

Thanks,
Marco

PS: When using the attached file make sure to change the “samples” array to point to your files :slight_smile: