(New) Root Memory checker

Slides:



Advertisements
Similar presentations
Chapter 18 Vectors and Arrays
Advertisements

Constructor. 2 constructor The main use of constructors is to initialize objects. A constructor is a special member function, whose name is same as class.
Introduction to Memory Management. 2 General Structure of Run-Time Memory.
1 Objects and ClassesStefan Kluth 1.6Objects and Classes 1.6What is an Object? 1.7Objects and Classes 1.8Object Interface, Class Inheritance, Polymorphism.
Lecture 3 Feb 4 summary of last week’s topics and review questions (handout) Today’s goals: Chapter 1 overview (sections 1.4 to 1.6) c++ classes constructors,
Plab 2003 Lecture 41 C++ - Classes. Plab 2003 Lecture 42 Motivating Example Goal: Graphics package Handle drawing of different shapes Maintain list of.
Processes CSCI 444/544 Operating Systems Fall 2008.
1 Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation –The new operator –The delete operator –Dynamic.
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
LECTURE LECTURE 17 More on Templates 20 An abstract recipe for producing concrete code.
chap13 Chapter 13 Programming in the Large.
10/16/ Realizing Concurrency using the thread model B. Ramamurthy.
Computer Science and Software Engineering University of Wisconsin - Platteville 2. Pointer Yan Shi CS/SE2630 Lecture Notes.
Pointers OVERVIEW.
1 Writing a Good Program 8. Elementary Data Structure.
 Managing the heap  Resource acquisition is initialization (RAII)  Overriding operator new and delete  Class-based memory pools.
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Analysis trains – Status & experience from operation Mihaela Gheata.
Debugging of # P. Hristov 04/03/2013. Introduction Difficult problem – The behavior is “random” and depends on the “history” – The debugger doesn’t.
Multi-Tasking The Multi-Tasking service is offered by VxWorks with its real- time kernel “WIND”.
HLT/AliRoot integration C.Cheshkov, P.Hristov 2/06/2005 ALICE Offline Week.
Statistical feature extraction, calibration and numerical debugging Marian Ivanov.
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
Computing for Alice at GSI (Proposal) (Marian Ivanov)
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
C Programming Chapters 11, . . .
October Test Beam DAQ. Framework sketch Only DAQs subprograms works during spills Each subprogram produces an output each spill Each dependant subprogram.
Marian Ivanov (New) Root Memory checker. Outlook ● Motivation ● New memory checker – Implementation – User interface – Examples ● AliRoot observations.
PROGRAMMING 1 – HELPER INSTRUCTIONS ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED BY NANCY M. AMATO AND JORY DENNY 1.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Analysis experience at GSIAF Marian Ivanov. HEP data analysis ● Typical HEP data analysis (physic analysis, calibration, alignment) and any statistical.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
AAF tips and tricks Arsen Hayrapetyan Yerevan Physics Institute, Armenia.
Debugging Tools for Charm++ Applications Filippo Gioachin University of Illinois at Urbana-Champaign.
Realizing Concurrency using the thread model
V4-18-Release P. Hristov 21/06/2010.
Marian Ivanov, Anar Manafov
Friend Class Friend Class A friend class can access private and protected members of other class in which it is declared as friend. It is sometimes useful.
Realizing Concurrency using the thread model
Protection of System Resources
Checking Memory Management
UNIX PROCESSES.
This pointer, Dynamic memory allocation, Constructors and Destructor
Dynamically Allocated Memory
Dynamic Memory Allocation Reference Variables
CSC 253 Lecture 8.
Realizing Concurrency using Posix Threads (pthreads)
Automatics, Copy Constructor, and Assignment Operator
CSC 253 Lecture 8.
Realizing Concurrency using the thread model
Pointers, Dynamic Data, and Reference Types
Dynamic Memory Allocation
CS179G, Project In Computer Science
Realizing Concurrency using the thread model
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
Indirection.
Use of Geant4 in experiment interactive frameworks AliRoot
Realizing Concurrency using the thread model
Realizing Concurrency using Posix Threads (pthreads)
Realizing Concurrency using the thread model
Class and Objects In a class, all the functions that operate on the data structure are grouped together in one place along with the data Like a struct.
C (and C++) Pointers April 4, 2019.
System Calls System calls are the user API to the OS
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Dynamic Memory CSCE 121.
Dynamic Binary Translators and Instrumenters
Offline framework for conditions data
Lecture 4 – Data collection List ADT
CS Introduction to Operating Systems
Presentation transcript:

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

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

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

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

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

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 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

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)

User interface – quering of information - output 58 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z9funObjectv+0x60) [0x6037dc] 58 (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() 60 58 2000.000000 56000.000000 1000 28000 59 58 2000.000000 56000.000000 2000 56000 62 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z9funObjectv+0x7b) [0x6037f7] 62 (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() 60 62 4000.000000 88890.000000 2000 44445 59 62 4000.000000 88890.000000 4000 88890 35 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so(_Z4funDv+0x91) [0x6034df] 35 (nil) /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funD() 35 35 2000.000000 471088.000000 200 46224 32 35 1992.000000 469304.000000 201 46440 32 35 1998.000000 470672.000000 201 46512

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/root6/HEAD/lib/libCore.so TStorage::ObjectAlloc(unsigned int) 3 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so funObject() 4 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so testMemstat2() 5 /home/miranov/root6/HEAD/memstat/src/testMemstat2_C.so [0x603a7e] 6 /home/miranov/root6/HEAD/lib/libCint.so Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) 7 /home/miranov/root6/HEAD/lib/libCint.so G__call_cppfunc 8 /home/miranov/root6/HEAD/lib/libCint.so G__interpret_func 9 /home/miranov/root6/HEAD/lib/libCint.so G__getfunction 10 /home/miranov/root6/HEAD/lib/libCint.so G__getitem 11 /home/miranov/root6/HEAD/lib/libCint.so G__getexpr Summary for selected: 0 0 22001.000000 1311756.000000 4600 188599

Time development

AliRoot observation All Summary for selected: 0 0 25382175.000000 77381358317.000000 1269965 226342517 CDB 0 0 464091.000000 303540208.000000 46530 102131007 libGeom 0 0 2346765.000000 214681572.000000 855006 74312716 ITS 0 0 10809874.000000 32580849816.000000 44414 69761886 MUON 0 0 7189011.000000 473414840.000000 495789 52071527 TRD 0 0 2090102.000000 8151845194.000000 67925 15438047 TPC 0 0 1573721.000000 35063547002.000000 20326 12634261 TOF 0 0 171168.000000 32524767.000000 20399 8060014

AliRoot observation draw.SortStack(TMemStatDraw::kTotalAllocCount,TMemStatDraw::kCurrent); draw.PrintStack(10,10) !!!!!!!!!!!!!!!!!!!!!!!!!! 475078 561163 - code trace 319594 0 2608128.000000 8012169216.000000 0 0 0 0 1.000000 3072.000000 1 3072 2 /home/miranov/root6/HEAD/lib/libCore.so TArrayF::Set(int, float const*) 3 /home/miranov/root6/HEAD/lib/libCore.so TArrayF::TArrayF(TArrayF const&) 4 /home/miranov/AliRoot7/HEAD/lib/tgt_linux/libITSbase.so AliITSCalibrationSSD::GetNoiseN() const 5 /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

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