Dear Root Experts,
I have meanwhile switched to
ROOT 5.24/00 (tags/v5-24-00@29258, Jul 01 2009, 12:22:53 on linuxx8664gcc)
but this problem still exists. Few sentences just to illustrate more clearly the problem:
1.) I want to use TFileMerger to merge a large amount of *.root files (~ 1 million files);
2.) It is impossible of course to add to TFileMerger in one go all those files, so I am merging them in cycles: in the first cycle I am adding first 100 files and I merge them and store in the file cycle1.root, then I reset TFileMerger and start the second cycle. At the beginning of second cycle I first add to TFileMerger the stored file cycle1.root and after it the next 100 files, and so on. Also, I am taking care than stored file from previous cycle is closed and deleted when I am progressing with the next cycle. In this way at once I have at maximum 101 files added in TFileMerger and this should work perfectly fine.
3.) But it doesn’t! The problem is that when I call at the and of the cycle:
fileMerger->Merge();
fileMerger->Reset();
the temporary *.root files created by TFileMerger in /tmp directory of the type
ROOTMERGE-f13636dc-6b01-11de-9717-0ec710c0beef.root
are not cleaned completely neither from the disk nor from the memory! More precisely: There is always AT LEAST one such file left over by TFileMerger both on disk and in memory per fileMerger->Merge() call. And as you can imagine, for 1000 cycles I am ending up with 1000 open files in memory and all the hell breaks loose. (I could figure out how to remove them ‘manually’ from the disk at the end of the cycle, but I couldn’t figure out how to close them ‘manually’ in memory at the end of the cycle…)
4.) I have attached again macro merge.C (I have added only call to Reset() method when compared to previous version I posted) with two *.root files that I want to merge and snapshot.png.
5.) Any help how to resolve this issue with TFileMerger is more than welcome.
6.) Alernatively, perhaps somebody could suggest another approach how to merge a larger number of *.root files (which in general contains TLists containing histograms and profiles).
Cheers,
Ante
file2.root (3.72 KB)
file1.root (3.71 KB)
merge.C (224 Bytes)