Re: [ROOT]Watching memory leaks and R__NOSTATS??

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jul 13 2001 - 11:48:19 MEST


Hi Caius,

By default, Root does not monitor the objects created.
In order to use gObjectTable->Print(), you must activate the memory statistics
option in the file system.rootrc (in $ROOTSYS/etc directory).
The default setting is:
# Activate memory statistics (size and cnt is used to trap allocation of
# blocks of a certain size after cnt times)
Root.MemStat:            0
Root.MemStat.size:      -1
Root.MemStat.cnt:       -1
Root.ObjectStat:         0


You can set it like:
# Activate memory statistics (size and cnt is used to trap allocation of
# blocks of a certain size after cnt times)
Root.MemStat:            1
Root.MemStat.size:      -1
Root.MemStat.cnt:       -1
Root.ObjectStat:         1

When used in a compiled program, you have, of course, to
#include "TObjectTable.h"

Rene Brun

Caius Howcroft wrote:
> 
> Hi, I'm tring to hunt down a memory leak in an app we have made with root
> Gui classes.
> 
> I see from the web site that gObjectTable->Print() can be used in cint to
> watch which objects are being newed and not deleted, but how can I call
> this in a stand alone app? Just gObjectTable->Print(); doesnt work as it
> doesnt know what gObectTable is?(I have TROOT at the start of my app)
> 
> I also tried to use a library I wrote for c++ which overrides the global
> new/delete new[]/delete[] operators.  However, roots own memory managment
> seems to conflict with this (namely TStorage).  In the online docs it says
> to
> "Set the compile option R__NOSTATS to de-activate all memory checking
>  and statistics gathering in the system. "
> Does this mean compile my app with -DR__NOSTATS or recompile root with
> setenv R__NOSTATS?
> And will this force root to use the normal new/delete operators?
> 
> Cheers..
> Caius
> 
> _______________________
> CAIUS HOWCROFT
> 01223 711 788 UK(home)
> 07977 473 937 UK(mobile)
> 01223 766 300 UK(Office)



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:51 MET