Hello all,
I have a root file of ~6GB in castor and I am trying my code on it.
For many events, it runs fine. I am also printing the value returned by
GetEntries() (“nb = …”)
For the first few events, it prints fine. But then it starts printing -1
and ultimately my program crashes at “this line in the code”:
for(int jentry=0; jentry<nentries; jentry++)
{
nb = fChain->GetEntries(jentry) /////// "this line in the code"
.......
}
printouts:
====NEW EVENT=====
entered into the loop
nb = 13118
event no. = 31
====NEW EVENT=====
entered into the loop
nb = 15105
event no. = 32
====NEW EVENT=====
entered into the loop
nb = 22041
event no. = 33
====NEW EVENT=====
entered into the loop
nb = 17495
event no. = 34
====NEW EVENT=====
entered into the loop
nb = 15700
event no. = 35
====NEW EVENT=====
entered into the loop
nb = 13613
event no. = 36
====NEW EVENT=====
entered into the loop
nb = 15839
event no. = 37
====NEW EVENT=====
.......................
entered into the loop
nb = -1
event no. = 395198
====NEW EVENT=====
entered into the loop
nb = -1
event no. = 395199
====NEW EVENT=====
entered into the loop
nb = -1
event no. = 395200
====NEW EVENT=====
entered into the loop
Fatal in <operator new>: storage exhausted (failed to allocate 1186257581 bytes)
aborting
Attaching to program: /proc/22153/exe, process 22153
[Thread debugging using libthread_db enabled]
0xffffe410 in __kernel_vsyscall ()
#1 0x00549713 in __waitpid_nocancel () from /lib/libc.so.6
#2 0x004ee07b in do_system () from /lib/libc.so.6
#3 0x00652ead in system () from /lib/libpthread.so.0
#4 0x56ff6b0d in TUnixSystem::Exec(char const*) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libCore.so
#5 0x56ffbfab in TUnixSystem::StackTrace() ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libCore.so
#6 0x56f28a16 in DefaultErrorHandler(int, bool, char const*, char const*) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libCore.so
#7 0x56f28662 in ErrorHandler ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libCore.so
#8 0x56f28733 in Fatal(char const*, char const*, ...) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libCore.so
#9 0x555597cc in operator new(unsigned int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libNew.so
#10 0x55559c2d in operator new[](unsigned int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libNew.so
#11 0x555d9f98 in TBasket::Streamer(TBuffer&) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#12 0x555da75d in TBasket::ReadBasketBuffers(long long, int, TFile*) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#13 0x555dd6d2 in TBranch::GetBasket(int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#14 0x555ddee5 in TBranch::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#15 0x5562a94c in TTree::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#16 0x556005f2 in TChain::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_ia32_gcc434/cms/cmssw/CMSSW_3_8_3/external/slc5_ia32_gcc434/lib/libTree.so
#17 0x08053ea2 in myPlot::Loop() ()
#18 0x0805bd2c in main ()
A debugging session is active.
is there a way to handle this?
Do I need to call setAutodelete(kTrue)?
Thanks for any help,
Shilpi