Marian Ivanov New Root Memory checker Outlook Motivation

  • Slides: 14
Download presentation
Marian Ivanov (New) Root Memory checker

Marian Ivanov (New) Root Memory checker

Outlook ● Motivation ● New memory checker ● – Implementation – User interface –

Outlook ● Motivation ● New memory checker ● – Implementation – User interface – Examples Ali. Root observations

Motivation ● The Ali. Root use to much memory – Memory checker needed ●

Motivation ● The Ali. Root 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

● ● ● Implementation – Classes Information Tinfo. Stamp – memory alocation information –

● ● ● Implementation – Classes Information Tinfo. Stamp – memory alocation information – Total. Count, Current. Count, Total. Size, Current. Size – Code ID, Stamp. Number Tcode. Info – Code information – address of the code – Tinfo. Stamps – current, last, max memory stamp, max alloc count – Integrated from all called function Tstack. Info – Array of code information – stack – Tinfo. Stamps – current, last, max memory stamp, max alloc count

Containers ● ● Mem. Stat. Manager – std vector of Code. Infos – std

Containers ● ● Mem. Stat. Manager – std vector of Code. Infos – std vector of Stack. Infos – std vector of Stamp. Infos – (evolving in time) Information dumped to the output tree – 1. On demand – 2. Automatic dump after reaching the predefined size

Principles ● Hook for alloc and free – ● ● Possibility to enable and

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)

User interface – acquiring data ● Start – TMem. Stat. Draw draw(100000, 1000); ●

User interface – acquiring data ● Start – TMem. Stat. Draw draw(100000, 1000); ● ● User specify the auto stamp size - Allocated size, Number of allocation Make stamps – (inside the code - macro) – draw. Add. Stamp("Start"); – fun. F(); – ● draw. Add. Stamp("fun. F"); Destructor – Close the file with stamps

User interface – quering of information ● ● ● Initialization from file - TMem.

User interface – quering of information ● ● ● Initialization from file - TMem. Stat. Draw draw("memstat. root") Select code information – draw. Select. Code("test. Memstat", "fun", TMem. Stat. Draw: : k. OR) – draw. Sort. Code(TMem. Stat. Draw: : k. Alloc. Size, TMem. Stat. Draw: : k. Current); – draw. Print. Code(10, 10) Select stack information – draw. Select. Stack(TMem. Stat. Draw: : k. OR) – draw. Sort. Stack(TMem. Stat. Draw: : k. Alloc. Size, TMem. Stat. Draw: : k. Current); – draw. Print. Stack(10, 10)

User interface – quering of information - output ● 58 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C.

User interface – quering of information - output ● 58 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so(_Z 9 fun. Objectv+0 x 60) [0 x 6037 dc] ● 58 (nil) /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so ● 60 58 2000. 000000 56000. 000000 1000 28000 ● 59 58 2000. 000000 56000. 000000 2000 56000 ● 62 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so(_Z 9 fun. Objectv+0 x 7 b) [0 x 6037 f 7] ● 62 (nil) /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so ● 60 62 4000. 000000 88890. 000000 2000 44445 ● 59 62 4000. 000000 88890. 000000 4000 88890 ● 35 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so(_Z 4 fun. Dv+0 x 91) [0 x 6034 df] ● 35 (nil) /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so ● 35 35 2000. 000000 471088. 000000 200 46224 ● 32 35 1992. 000000 469304. 000000 201 46440 ● 32 35 1998. 000000 470672. 000000 201 46512 fun. Object() fun. D()

User interface – quering of information - output ● 34 39 - code trace

User interface – quering of information - output ● 34 39 - code trace ● 60 34 2000. 000000 56000. 000000 1000 28000 ● 59 34 2000. 000000 56000. 000000 2000 56000 ● 1 /home/miranov/root 6/HEAD/lib. Core. so TStorage: : Object. Alloc(unsigned int) ● 3 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so fun. Object() ● 4 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so test. Memstat 2() ● 5 /home/miranov/root 6/HEAD/memstat/src/test. Memstat 2_C. so [0 x 603 a 7 e] ● 6 /home/miranov/root 6/HEAD/lib. Cint. so Cint: : G__Exception. Wrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) ● 7 /home/miranov/root 6/HEAD/lib. Cint. so G__call_cppfunc ● 8 /home/miranov/root 6/HEAD/lib. Cint. so G__interpret_func ● 9 /home/miranov/root 6/HEAD/lib. Cint. so G__getfunction ● 10 /home/miranov/root 6/HEAD/lib. Cint. so G__getitem ● 11 /home/miranov/root 6/HEAD/lib. Cint. so G__getexpr ● Summary for selected: ● 0 0 22001. 000000 1311756. 000000 4600 188599

Time development

Time development

Ali. Root observation ● All ● Summary for selected: ● 0 ● CDB ●

Ali. Root observation ● All ● Summary for selected: ● 0 ● CDB ● Summary for selected: ● 0 ● lib. Geom ● Summary for selected: ● 0 ● ITS ● Summary for selected: ● 0 ● MUON ● Summary for selected: ● 0 ● TRD ● Summary for selected: 0 0 0 25382175. 000000 77381358317. 000000 464091. 000000 303540208. 000000 2346765. 000000 214681572. 000000 10809874. 000000 32580849816. 000000 7189011. 000000 473414840. 000000 1269965 226342517 46530 102131007 855006 74312716 44414 69761886 495789 52071527

Ali. Root observation ● draw. Sort. Stack(TMem. Stat. Draw: : k. Total. Alloc. Count,

Ali. Root observation ● draw. Sort. Stack(TMem. Stat. Draw: : k. Total. Alloc. Count, TMem. Stat. Draw: : k. Current); ● draw. Print. Stack(10, 10) ● !!!!!!!!!!!!! ● 475078 561163 - code trace ● 319594 0 ● 0 0 1. 000000 3072. 000000 1 3072 ● 2608128. 000000 8012169216. 000000 0 0 – 2 /home/miranov/root 6/HEAD/lib. Core. so TArray. F: : Set(int, float const*) – 3 /home/miranov/root 6/HEAD/lib. Core. so TArray. F: : TArray. F(TArray. F const&) – 4 /home/miranov/Ali. Root 7/HEAD/lib/tgt_linux/lib. ITSbase. so Ali. ITSCalibration. SSD: : Get. Noise. N() const – 5 /home/miranov/Ali. Root 7/HEAD/lib/tgt_linux/lib. ITSsim. so Ali. ITSsimulation. SSD: : Apply. Noise(Ali. ITSp. List* CODE ? ? ? ? ? ? ? ? – TArray. F Get. Noise. N() const {return f. Nois. N; } – TArray. F Get. Noise. P() const {return f. Nois. N; } – TArray. F Get. Gain. P() const {return f. Gain. P; } – TArray. F Get. Gain. N() const {return f. Gain. N

Future plans ● ● Commit memstat package to ROOT – Still some aspects of

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