Write BIG object fails

Hello dear Rooters,

I am trying to write a (derived from TObject) class object to a file.
This object is very large, about 10Gb when it is in the RAM.

But after a while writing, root crashes. May I give you the gDebug=4 output, maybe the problem is very simple…

 WriteBuffer for class: TStreamerBasicType version 2 has written 73 bytes
WriteBuffer, class:TStreamerBasicType, name=TStreamerElement, fType[0]=0, TStreamerBase, bufpos=7025, arr=0x61944d5b0, offset=0
WriteBuffer, class:TStreamerElement, name=TNamed, fType[0]=67, TStreamerBase, bufpos=7031, arr=0x61944d5b0, offset=0
WriteBuffer, class:TNamed, name=TObject, fType[0]=66, TStreamerBase, bufpos=7037, arr=0x61944d5b0, offset=0
WriteBuffer, class:TNamed, name=fName, fType[1]=65, TStreamerString, bufpos=7047, arr=0x61944d5b0, offset=16
WriteBuffer, class:TNamed, name=fTitle, fType[2]=65, TStreamerString, bufpos=7051, arr=0x61944d5b0, offset=32
 WriteBuffer for class: TNamed version 1 has written 17 bytes
WriteBuffer, class:TStreamerElement, name=fType, fType[1]=23, TStreamerBasicType, bufpos=7052, arr=0x61944d5b0, offset=48
WriteBuffer, class:TStreamerElement, name=fMaxIndex, fType[2]=23, TStreamerBasicType, bufpos=7068, arr=0x61944d5b0, offset=64
WriteBuffer, class:TStreamerElement, name=fTypeName, fType[3]=65, TStreamerString, bufpos=7088, arr=0x61944d5b0, offset=96
 WriteBuffer for class: TStreamerElement version 4 has written 67 bytes
 WriteBuffer for class: TStreamerBasicType version 2 has written 73 bytes
   TKey Writing 2230 bytes at address 212 for ID= StreamerInfo Title= Doubly linked list

 *** Break *** segmentation violation

The stack trace looks like this:

0x0000003166897f85 in waitpid () from /lib64/libc.so.6
#1  0x000000316683bf33 in do_system () from /lib64/libc.so.6
#2  0x00002ae5281f33f6 in TUnixSystem::StackTrace () from /home/scanner/root522a/lib/libCore.so.5.22
#3  0x00002ae5281f1213 in TUnixSystem::DispatchSignals () from /home/scanner/root522a/lib/libCore.so.5.22
#4  <signal handler called>
#5  0x0000000001000000 in ?? ()
#6  0x00002ae52a06b394 in TDirectoryFile::WriteKeys () from /home/scanner/root522a/lib/libRIO.so.5.22
#7  0x00002ae52a067d51 in TDirectoryFile::SaveSelf () from /home/scanner/root522a/lib/libRIO.so.5.22
#8  0x00002ae52a06bc4b in TDirectoryFile::Save () from /home/scanner/root522a/lib/libRIO.so.5.22
#9  0x00002ae52a067dbb in TDirectoryFile::Close () from /home/scanner/root522a/lib/libRIO.so.5.22
#10 0x00002ae52a0783a1 in TFile::Close () from /home/scanner/root522a/lib/libRIO.so.5.22
#11 0x00002ae52a0786e7 in TFile::~TFile$delete () from /home/scanner/root522a/lib/libRIO.so.5.22
#12 0x00002ae52819dc19 in TCollection::GarbageCollect () from /home/scanner/root522a/lib/libCore.so.5.22
#13 0x00002ae5281a3007 in TList::Delete () from /home/scanner/root522a/lib/libCore.so.5.22
#14 0x00002ae5281eec70 in TUnixSystem::Exit () from /home/scanner/root522a/lib/libCore.so.5.22
#15 0x00002ae52811fca4 in TApplication::ProcessLine () from /home/scanner/root522a/lib/libCore.so.5.22
#16 0x00002ae529956b63 in TRint::HandleTermInput () from /home/scanner/root522a/lib/libRint.so.5.22
#17 0x00002ae5299553c7 in TTermInputHandler::Notify () from /home/scanner/root522a/lib/libRint.so.5.22
#18 0x00002ae52995747d in TTermInputHandler::ReadNotify () from /home/scanner/root522a/lib/libRint.so.5.22
#19 0x00002ae5281f0e53 in TUnixSystem::CheckDescriptors () from /home/scanner/root522a/lib/libCore.so.5.22
#20 0x00002ae5281f138a in TUnixSystem::DispatchOneEvent () from /home/scanner/root522a/lib/libCore.so.5.22
#21 0x00002ae528172d46 in TSystem::InnerLoop () from /home/scanner/root522a/lib/libCore.so.5.22
#22 0x00002ae5281756f1 in TSystem::Run () from /home/scanner/root522a/lib/libCore.so.5.22
#23 0x00002ae52811ec6f in TApplication::Run () from /home/scanner/root522a/lib/libCore.so.5.22
#24 0x00002ae529957080 in TRint::Run () from /home/scanner/root522a/lib/libRint.so.5.22
#25 0x000000000040103d in main ()

And the root .C macro code is like:

TFile* file = new TFile(fname,option);

where gAli is the Object which I want to write.

Any comment is appreciated, thank you.
Best regards.

You cannot write objects greater than 1 Gigabyte as a single key to a file. You must split your object in sub-components.


Thank you Rene.
I guess I cannot split this, then Ill have to think of a different solution. Desolee.
Post closed.