Re: Merging with 'hadd' results in 'std::bad_alloc'

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 11 Oct 2011 08:21:25 -0500


Hi Ida,

Could you try with v5.30? What is the minimal number of files needed to reached this problem (i.e. does it also crash if you merge only 5 files)? Does it matter which file you try to merge with (i.e. if you merge 6 times with the first file does it also crash)? Was there any stack trace information?

Philippe.

On 10/11/11 8:14 AM, Ida Häggström wrote:
> Hello!
>
> I'll start with some info:
> Root version: 5.28/00a (21 February 2011)
> OS: Ubuntu version 10.10 (as a guest via VirtualBox4.0.4 on host Windows 7)
> Memory:
>
> I'm experiencing some problems when trying to merge some root files. I have six files (around 1.1 GB each) that I want to merge.
> The files contain the same structure (four different trees + some histograms each). I'm trying to use the 'hadd' method, but after
> a couple of hours it crashes with the message "terminate called after throwing an instance of 'std::bad_alloc'" (see below).
> I've googled the issue and figured I run out of memory (I'm not so skilled with root or C++!).
>
> I found a thread addressing a similar issue as mine (http://root.cern.ch/phpBB3/viewtopic.php?t=9008) where it was suggested to
> flush the baskets of each root file, then use hadd. I've tried this according to:
> TFile f(fileName.c_str(),"update");
> cout << "Flushing \"finalCoinci\"..." << endl;
> TTree *T1 = (TTree*)f.Get("finalCoinci");
> T1->FlushBaskets();
> T1->Write();
>
> but I still get the same error.
>
> ------------------------------------------------
> hadd test.root rootOutput*
> Target file: test.root
> Source file 1: rootOutput_Prompts_t0-1.root
> Source file 2: rootOutput_Prompts_t0-2.root
> Source file 3: rootOutput_Prompts_t0-3.root
> Source file 4: rootOutput_Prompts_t0-4.root
> Source file 5: rootOutput_Prompts_t0-5.root
> Source file 6: rootOutput_Prompts_t0-6.root
> Target path: test.root:/
> rootOutput_Prompts_t0-1.root tree:finalCoinci entries=1234567890
> rootOutput_Prompts_t0-2.root tree:finalCoinci entries=1234567890
> rootOutput_Prompts_t0-3.root tree:finalCoinci entries=1234567890
> rootOutput_Prompts_t0-4.root tree:finalCoinci entries=1234567890
> rootOutput_Prompts_t0-5.root tree:finalCoinci entries=1234567890
> rootOutput_Prompts_t0-6.root tree:finalCoinci entries=1234567890
> terminate called after throwing an instance of 'std::bad_alloc'
> what(): std::bad_alloc
> Aborted
> ------------------------------------------------
>
Received on Tue Oct 11 2011 - 15:21:36 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 12 2011 - 11:50:02 CEST