Problem with merging big THnSparse objects


I am trying to merge serveral ROOT files using the hadd tool.
Each file contains a single THnSparse histogram.
I have no problems while the ROOT files are small, but when I am trying to merge bigger THnSparse objects (~500 MB each), I get the following error:

Error in <TExMap::FindElement>: table full Error in <TExMap::Expand>: slot 0 not empty (should never happen)
and the program crashes.

I can not reproduce the error with smaller files, so I am not attaching them here. If necessary, I can upload the files on a public web server.

My ROOT version is 5.34/01.


Interesting. Yes, would you be able to give me access to the files, please?

Cheers, Axel

I am having the same issue while trying to merge several ROOT files containing THnSparse histogram. Was there a solution to this problem?

Thank you.

I don’t remember finding any solution to this problem.

I guess @Axel will need access to your files for inspection.

BTW. Is it possible that the merging process tries to create a histogram which is too big to be stored in a ROOT file (there exists a 1GB TFile buffer/basket limit)?

Thank you.

The file can be found at the link above. I am trying to add > 1000 of such type of files. I am not sure if this is a size issue, I have merged same number of similar type of files without THnSparse (however those were bigger in size).

Hi @Sbecka,
thank you for sharing the files. Note that the original post was from 2012, so it might or might not apply.

It would be great if you could open a bug report at with this same link to the files and also a minimal reproducer (the smallest snippet of code that we can run and that reproduces the problem). That would greatly help us figure out what the problem is.