Make a TFile delete its objects, that were read into memory?

From: Hans Dembinski <dembinski_at_physik.rwth-aachen.de>
Date: Thu, 19 Jul 2007 13:31:51 +0200


Dear Root users/developers,

I have a program, which reads repeadidly TH2Ds from a TFile and works with them, using the TFile::Get( ) method.

It appears to me, as if this method creates a new object on the heap for every Get( ) call, even when the same object was already loaded into the memory, resulting in a large memory consumption after some time.

However, I found a way to stop this by closing and reopening the TFile regularly at a certain point in the program, which nicely deletes all theses memory copies of its content.

My question is, is there a more elegant way to delete and/or limit the memory copies without manually keeping track of the pointers or by simply closing the file and reopening it?

Thanks and best regards,
 Hans

-- 
Dipl.-Phys. Hans Dembinski

Tel.: +49 241 80 27324

III. Phys. Inst. A (3A)
Physikzentrum
RWTH Aachen
52056 Aachen
Received on Thu Jul 19 2007 - 13:43:34 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 19 2007 - 17:50:02 CEST