Hi,
I need to store a large tree, (bigger than 1.9GB), during the course of filling tree, I need to read back some previous entries, so the memory exhast while reading the entries.
My root version 4.00.06, memory of my computer is 1GB, and the code is as follows:
TFile aFile = new TFile(“aFile.root”, “RECREATE”);
TTRee::SetMaxTreeSize(1000Long64_t(2000000000));
TTree *aTree = new TTree(“aTree”, “aTree”);
Double_t weight;
aTree->Branch(“weight”, &weight, “weight/D”);
for(Long64_t i = 0; i < Long64_t(500000000); i++) {
weight = gRandom->Rndm(1);
aTree->Fill();
}
aTree->Write();
for(Long64_t i = 0; i < aTree->GetEntries(); i++) {
aTree->GetEntry(i);
}
aFile->Close();
Memory exhausts while call aTree->GetEntry(i);
which seems to read all entries into the memory, what’s wrong?
Thanks!
Charles