Increased memory consumption of root 5.12.00?


Has anyone observed increased memory consumption with root 5.12.00 and
is the reason (and remedies?) known ?

At the H1 Experiment we use root for our centrally maintained production of analysis
data. We have a data selection program in which trees are cloned for subsets
(eventlists) of selected events.

During the event loop the memory consumption increases from initially 80 MB to 200 MB
and then to 500 MB (exact numbers depending on data set and history)…
In addition we see spurious crashes with the message R__unzip: error in header.

The same H1 code, when used with root 5.11.06 is showing normal behaviour (memory
constant around ~80 MB). With root 4.04.02 it is ~50 MB.

We have noticed that the compression mode was changed from R__ZipMode = 0
to R__ZipMode = 1. Could that explain the effect?

Suggestions/ideas welcome.

cheers, Andreas

Hi Andreas,

When you loop on your files, are you keeping many files open at the same time? How many files do you have?
I assume that your files contain Trees, could you add the statement
after having read the Tree header from the file.
If this fixes the problem, could you
myh1tree.SetCacheSize(100000); //100 Kbytes, default is 10 Mbytes

Let me know


Hi Rene,

I tried TTree::SetCacheSize(0) and it brings the memory down to 100MB. Good!
This solves the problem for all practical purposes.

Trying cache sizes larger than 0 has no effect, i.e. the memory consumption is
essentially the same as with the default of 10MB.

For info: In our selection facility program we usually read in 1-3 files
(HAT 0.5KB/evt, mODS 2kb/evt, ODS20kb/evt) - the usual case is just HAT and mODS
and write out up to 4 files (including an optional user defined tree).

Is it useful to also play around with the settings for TFileCacheWrite and TFileCacheRead ?



I would like to understand this problem. Could you prepare the smallest possible setup reproducing the problem: a tar file and the address of one or more files necessary to show the leak?