> i.e. neither "delete myReco" nor "delete reco_ch" free any memory and I
> end up with a memory leakage.
This is odd. How did you assert that the memory did not decrease?
I recommend that you use valgrind (http://valgrind.kde.org) to detect where the memory leak (if any) are coming.
Cheers,
Philippe
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
On Behalf Of Carlos Osuna
Sent: Wednesday, February 21, 2007 4:51 AM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] memory leakage using TChains
Hi all,
I have generated a class, named Reco.h, associated to a tree with MakeClass. Then, in my analysis I create a TChain and the corresponding object of the type RecoAna with this tchain.
TChain *reco_ch = new TChain("Reco");
reco_ch->Add(file1);
Reco *myReco = new Reco(reco_ch);
and I perform my analysis without any problem. And now, I want to free
up some memory, in order to load more ntuples, but deleting the objects
does not seem to free its memory.
i.e. neither "delete myReco" nor "delete reco_ch" free any memory and I
end up with a memory leakage.
Has anybody a hint on how could I really remove those objects from the
memory?
(Im using root version 5.10 on slc3)
thanks in advance for the help. carlos Received on Wed Feb 21 2007 - 17:13:35 CET
This archive was generated by hypermail 2.2.0 : Wed Feb 21 2007 - 23:50:01 CET