Presentation is loading. Please wait.

Presentation is loading. Please wait.

(New) Root Memory checker

Similar presentations


Presentation on theme: "(New) Root Memory checker"— Presentation transcript:

1 (New) Root Memory checker
Marian Ivanov (New) Root Memory checker

2 Outlook Motivation New memory checker AliRoot observations
Implementation User interface Examples AliRoot observations

3 Motivation The AliRoot use to much memory Memory checker needed
Valgrind and vtune – too slow – difficult to run realistic simulation reconstruction ( factor 50 slow down) We need some automatic procedure to check the quality of code – Optimally done during the nightly builds + Sending message to the top violators Number of new – deletes Total and current allocated space – development in time Selective queries – per libraries – per functions

4 Implementation – Classes - Information
TinfoStamp memory alocation information – TotalCount, CurrentCount, TotalSize, CurrentSize Code ID, StampNumber TcodeInfo Code information – address of the code TinfoStamps – current, last, max memory stamp, max alloc count Integrated from all called function TstackInfo Array of code information – stack

5 Containers MemStatManager Information dumped to the output tree
std vector of CodeInfos std vector of StackInfos std vector of StampInfos – (evolving in time) Information dumped to the output tree 1. On demand 2. Automatic dump after reaching the predefined size

6 Principles Hook for alloc and free Possibility to enable and disable
Alloc hook: Get the stack trace Register the new stack trace if not registered yet Register memory for given stack (increase counters) Free hook Unregister memory for stack created given pointer (decrease counters)

7 User interface – acquiring data
Start TMemStatDraw draw(100000,1000); User specify the auto stamp size - Allocated size, Number of allocation Make stamps – (inside the code - macro) draw.AddStamp("Start"); funF(); draw.AddStamp("funF"); Destructor Close the file with stamps

8 User interface – quering of information
Initialization from file - TMemStatDraw draw("memstat.root") Select code information draw.SelectCode("testMemstat","fun",TMemStatDraw::kOR) draw.SortCode(TMemStatDraw::kAllocSize,TMemStatDraw::kCurrent); draw.PrintCode(10,10) Select stack information draw.SelectStack(TMemStatDraw::kOR) draw.SortStack(TMemStatDraw::kAllocSize,TMemStatDraw::kCurrent); draw.PrintStack(10,10)

9 User interface – quering of information - output
58 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z9funObjectv+0x60) [0x6037dc] (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() 62 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z9funObjectv+0x7b) [0x6037f7] (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() 35 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z4funDv+0x91) [0x6034df] (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funD()

10 User interface – quering of information - output
code trace /home/miranov/root6/HEAD/lib/libCore.so TStorage::ObjectAlloc(unsigned int) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so testMemstat2() /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so [0x603a7e] /home/miranov/root6/HEAD/lib/libCint.so Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) /home/miranov/root6/HEAD/lib/libCint.so G__call_cppfunc /home/miranov/root6/HEAD/lib/libCint.so G__interpret_func /home/miranov/root6/HEAD/lib/libCint.so G__getfunction /home/miranov/root6/HEAD/lib/libCint.so G__getitem /home/miranov/root6/HEAD/lib/libCint.so G__getexpr Summary for selected:

11 Time development

12 AliRoot observation All Summary for selected:
CDB libGeom ITS MUON TRD TPC TOF

13 AliRoot observation draw.SortStack(TMemStatDraw::kTotalAllocCount,TMemStatDraw::kCurrent); draw.PrintStack(10,10) !!!!!!!!!!!!!!!!!!!!!!!!!! code trace /home/miranov/root6/HEAD/lib/libCore.so TArrayF::Set(int, float const*) /home/miranov/root6/HEAD/lib/libCore.so TArrayF::TArrayF(TArrayF const&) /home/miranov/AliRoot7/HEAD/lib/tgt_linux/libITSbase.so AliITSCalibrationSSD::GetNoiseN() const /home/miranov/AliRoot7/HEAD/lib/tgt_linux/libITSsim.so AliITSsimulationSSD::ApplyNoise(AliITSpList* CODE ???????????????????????????????? TArrayF GetNoiseN() const {return fNoisN; } TArrayF GetNoiseP() const {return fNoisN; } TArrayF GetGainP() const {return fGainP; } TArrayF GetGainN() const {return fGainN

14 Future plans Commit memstat package to ROOT
Still some aspects of user interface to be discussed Work on graphic interface – inside of ROOT Make set of automatic procedure Triggered during nightly builds Possible already now


Download ppt "(New) Root Memory checker"

Similar presentations


Ads by Google