Hi Dimitris,
The message is quite clear "Storage exhausted".
You never delete the
objects you are reading in.
You should use (preferably the option SetAutoDelete described
in the 2.23/12 releas notes or simply, add the statement
delete a; a=0;
after (or instead of your statement a->Dump() in the loop.
Rene Brun
On Thu, 9 Mar 2000, Dr. D. Sideris wrote:
> Dear Rooters,
>
> I am trying to read in a tree that contains a class called PDEvent. I use the following macro:
>
> {
> //example of macro to read the Tree generated in Amain.cxx
>
> gSystem->Load("D:/root/udll/PDEvent.dll");
> TFile *f = new TFile("test.root");
> TTree *T = (TTree*)f->Get("T");
> PDEvent *a=0;
> T->SetBranchAddress("event",&a);
>
> Int_t nentries = (Int_t)T->GetEntries();
>
> T->Print();
>
> printf("ent=%8i\n",nentries);
> for (Int_t i=0;i<1;i++) {
> T->GetEntry(i);
> // if (a->fA >0.001) continue;
> printf("Print entry:%d\n",i);
> a->Dump();
> }
> }
>
> when I run it I get:
>
>
> D:\root\readmicro\main>root
> the current keyboard layout is 437
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 2.23/12 1 February 2000 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> CINT/ROOT C/C++ Interpreter version 5.14.25, Nov 25 1999
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] .x rroot.C
> ******************************************************************************
> *Tree :T : hello *
> *Entries : 15507 : Total Size = 19085418 bytes File Size = 7481805 *
> * : : Tree compression factor = 2.55 *
> ******************************************************************************
> *Branch :event : event *
> *Entries : 15507 : Total Size = 19076611 bytes File Size = 7472998 *
> *Baskets : 620 : Basket Size = 32000 bytes Compression= 2.55 *
> *............................................................................*
> ent= 15507
> Fatal in <operator new>: storage exhausted
> aborting
> Warning in <TWinNTSystem::StackTrace>: this method must be overridden!
>
> abnormal program termination
>
> D:\root\readmicro\main>
>
>
> any ideas what's wrong?
>
> Dimitris
>
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:21 MET