Hi Pierre, There is nothing obviously wrong in the code. With the latest ROOT the proper sequences of constructor and destructor seems to be called for your IoSdStation. So my only guess would be to look carefully at the implementation of the assignement operator for that class (which you did not send). Even if there was a memory leak, the fact that you accumulate memory until it crashes leads me to believe that you have a very large number of IoSdEvent object. Is there a reason you chose not to use a TTree for this purpose? It seems like it would be much more efficient. Cheers, Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Pierre Da Silva Sent: Friday, June 27, 2003 9:06 AM To: roottalk@pcroot.cern.ch Subject: [ROOT] problem with stl functions Dear rooters, We have a TFile filled with "IoSdEvent" objects. When we take one object out (see the piece of code below), memory is growing up until everything crashes. We know that this came from one vector of "IoSdStation" objects, but we don't know how and why. Notice that this problem only appears when reading the objects, and not when writing them on the file. TFile f3("converted.root","READ"); TList *list = f3.GetListOfKeys(); TIter next(list); TKey *tmpkey; IoSdEvent mem; while((tmpkey = (TKey *)next())) { tmpkey->Read((TObject *)&mem); cout<<" "<<mem.Id<<endl; } I join our classes in the attached file. Thanks in advance. ############################### Pierre Da Silva Email: pdasilva@lpnhep.in2p3.fr Tel.: 01 44 27 62 74 LPNHE 4, place Jussieu Tour 33 - Rez de Chaussee 75252 PARIS Cedex 05 - FRANCE Tel.: 01 44 27 63 13 Fax: 01 44 27 46 38 ############################### ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# #################################################################
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET