NOVA art. memory leaking Alexey Naumov Lebedev Physical Institute Moscow 1.

Slides:



Advertisements
Similar presentations
Verifying Performance of a HDL design block
Advertisements

CHECKING MEMORY SAFETY AND TEST GENERATION USING B LAST By: Pashootan Vaezipoor Computing Science Dept of Simon Fraser University.
Recitation By yzhuang, sseshadr. Agenda Debugging practices – GDB – Valgrind – Strace Errors and Wrappers – System call return values and wrappers – Uninitialization.
SPLINT STATIC CHECKING TOOL Sripriya Subramanian 10/29/2002.
Introduction to basic programming Kai Zang Jul 2 nd, 2012.
On Valgrind Mike Kordosky UCL Ely, if you are so unlucky as to have need of it.
Pointer, malloc and realloc 1. Name entered was 6 char, not enough space to put null terminator 2 Array of char.
Managing Memory Static and Dynamic Memory Type Casts Allocating Arrays of Dynamic Size Resizing Block of Memory Returning Memory from a Function Avoiding.
CSc 352 Freeing Dynamically Allocated Memory Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
CS 241 Section Week #2 2/4/10. 2 Topics This Section MP1 overview Part1: Pointer manipulation Part2: Basic dictionary structure implementation Review.
DEBUGGING IN THE REAL WORLD : Recitation 4.
David Notkin Autumn 2009 CSE303 Lecture 16 #preprocessor Debugging is twice as hard as writing the code in the first place. Therefore, if you write the.
CSE 303 Lecture 13a Debugging C programs
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
Control and monitoring of on-line trigger algorithms using a SCADA system Eric van Herwijnen Wednesday 15 th February 2006.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
File System Review bottomupcs.com J. Kubiatowicz, UC Berkeley.
Computer Science and Software Engineering University of Wisconsin - Platteville 2. Pointer Yan Shi CS/SE2630 Lecture Notes.
RPROM , 2002 Lassi A. Tuura, Northeastern University Using Valgrind Lassi A. Tuura Northeastern University,
Pointers OVERVIEW.
CS 241 Section Week #2 9/9/10. 2 Topics This Section MP1 issues MP2 overview Process creation using fork()‏ Debugging tools: valgrind, gdb.
Dynamic memory allocation and Pointers Lecture 4.
® IBM Software Group © 2006 IBM Corporation PurifyPlus on Linux / Unix Vinay Kumar H S.
Timing Programs and Performance Analysis Tools for Analysing and Optimising advanced Simulations.
Review Binary Numbers Bit : 0 or 1 Byte: 8 bites 256 different values 2 8 KB : 1024 bytes 2 10 bytes MB : 1024 * 1024 bytes 2 10 * 2 10 (2 20 ) bytes GB.
1 Original Source : and Problem and Problem Solving.ppt.
CPS4200 Unix Systems Programming Chapter 2. Programs, Processes and Threads A program is a prepared sequence of instructions to accomplish a defined task.
 Structures are like arrays except that they allow many variables of different types grouped together under the same name. For example you can create.
1 More Operator Overloading Chapter Objectives You will be able to: Define and use an overloaded operator to output objects of your own classes.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 10 – C: the heap and manual memory management.
Cho, Ho-Gi OS Lab. Cho, Ho-Gi OS Lab. How to Shadow Every Byte of Memory Used by a Program
1 Debugging (Part 2). “Programming in the Large” Steps Design & Implement Program & programming style (done) Common data structures and algorithms Modularity.
Improving Cache Performance of OCaml Programs Case Study - MetaPRL Alexey Nogin and Alexei Kopylov April 15, 1999.
1 Queues and Lists. QUEUES Very similar to stacks The only difference between them is in the order in which elements are processed. A stack uses a last-in/first-out.
1 C Basics Monday, August 30, 2010 CS 241. Announcements MP1, a short machine problem, will be released today. Due: Tuesday, Sept. 7 th at 11:59pm via.
Analysis experience at GSIAF Marian Ivanov. HEP data analysis ● Typical HEP data analysis (physic analysis, calibration, alignment) and any statistical.
Computer Performance. Hard Drive - HDD Stores your files, programs, and information. If it gets full, you can’t save any more. Measured in bytes (KB,
Debugging Malloc Lab Detecting Memory-Related Errors.
CSE 333 – SECTION 2 Memory Management. Questions, Comments, Concerns Do you have any? Exercises going ok? Lectures make sense? Homework 1 – START EARLY!
HP-SEE Valgrind Usage Josip Jakić Scientific Computing Laboratory Institute of Physics Belgrade The HP-SEE initiative.
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
1© Copyright 2015 EMC Corporation. All rights reserved. NUMA(YEY) BY JACOB KUGLER.
Dynamic Instrumentation - Valgrind  Developed by Julian Seward at/around Cambridge University,UK  Google-O'Reilly Open Source Award for "Best Toolmaker"
Memory Leaks and Valgrind
(New) Root Memory checker
CDF Offline Operations
Debugging Memory Issues
Linux 103 Training MOdule Basic System Mgmt.
Analysis trains – Status & experience from operation
Valgrind Overview What is Valgrind?
Payload Type The following notes illustrate debugging a linked list implementation with gdb. The example makes use of the following payload type: struct.
2016.
Advanced course of C/C++
Checking Memory Management
Analysis framework - status
Recitation: C Review TA’s 19 Feb 2018.
CS157: Dynamic Memory Dynamic Memory 11/9/201804/25/06.
Dynamic Instrumentation - Valgrind
Storage.
ניפוי שגיאות - Debugging
Memory Allocation CS 217.
TUTORIAL 7 CS 137 F18 October 30th.
CISC 361 Operating Systems Midterm Review
Linked Lists.
Block I/O fread and fwrite functions are the most efficient way to read or write large amounts of data. fread() – reads a specified number of bytes from.
Payload Type The following notes illustrate debugging a linked list implementation with gdb. The example makes use of the following payload type: struct.
Valgrind Overview What is Valgrind?
Dynamic Memory – A Review
Makefiles, GDB, Valgrind
Presentation transcript:

NOVA art. memory leaking Alexey Naumov Lebedev Physical Institute Moscow 1

Leaking? Running $nova –n -500 –c prodgenie.fcl prodgenie.fcl: >> #list the modules for this path, order matters, filters reject all following items >>simulate: [ generator, geantgen, photrans, daq ] Events Memory usage (mb) (3.6GB) ~ 400kb losses per event! 2

How detect source of leaking? - ‘top’ command [ display top CPU processes ] output: - ‘Valgrind’ [ tool for detect memory usage ] output: ==7158== 81,500 (80 direct, 81,420 indirect) bytes in 1 blocks are definitely lost in loss record 57,587 of 57,672 ==7158== at 0x4A07F61: malloc (vg_replace_malloc.c:236) ==7158== by 0x4F79D73: operator new(unsigned long) (in /grid/fermiapp/nova/novaart/externals /art/v0_06_01/slf5.x86_$ ==7158== by 0x2E1C87D9: G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(G4VPreCompoundModel*) (in /grid/$ ==7158== by 0x3A7CE497: G4QGSPProtonBuilder::G4QGSPProtonBuilder(bool, bool) (in /grid/fermiapp/nova/novaart/externals-0.$ ==7158== by 0x3AB4DDD9: HadronPhysicsQGSP_BERT::CreateModels() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/v4_$ ==7158== by 0x3AB4E158: HadronPhysicsQGSP_BERT::ConstructProcess() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4$ ==7158== by 0x3B8083D4: G4VModularPhysicsList::ConstructProcess() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/$ ==7158== by 0x3B7F7F7F: G4RunManagerKernel::InitializePhysics() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/v4$ ==7158== by 0x3B7F9724: G4RunManager::InitializePhysics() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/v4_9_4_p$ ==7158== by 0x3B7F9A8F: G4RunManager::Initialize() (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/v4_9_4_p01/Linu$ ==7158== by 0x3B7FF79E: G4RunMessenger::SetNewValue(G4UIcommand*, G4String) (in /grid/fermiapp/nova/novaart/externals-0.2$ ==7158== by 0x35F1EBDF: G4UIcommand::DoIt(G4String) (in /grid/fermiapp/nova/novaart/externals-0.2.0/geant4/v4_9_4_p01/Lin$ ==7158== ==7158== 81,500 (80 direct, 81,420 indirect) bytes in 1 blocks are definitely lost in loss record 57,588 of 57,672 ==7158== at 0x4A07F61: malloc (vg_replace_malloc.c:236) ==7158== by 0x4F79D73: operator new(unsigned long) (in /grid/fermiapp/nova/novaart/externals-0.2.0/art/v0_06_01/slf5.x86_$ anaumov m 44m 36m R :00.34 nova st3mag m 184m 79m S :04.38 nova xbhuang m 166m 77m S :10.98 nova anaumov m 86m 64m R :01.59 nova st3mag m 184m 79m S :04.45 nova xbhuang m 166m 77m S :10.98 nova anaumov m 119m 66m S :02.20 nova xbhuang m 166m 77m S :10.98 nova st3mag m 184m 79m S :04.45 nova xbhuang m 166m 77m S :10.98 nova 3

Memory usage during generation by ‘top’ command prodgenie.fcl (line 48): >> #list the modules for this path, order matters, filters reject all following items >>simulate: [ generator, geantgen, photrans, daq ] 4

Valgrind output output: ==7158== 171,304 bytes in 2,343 blocks are possibly lost in loss record 57,660 of 57,672 ==7158== at 0x4A07F61: malloc (vg_replace_malloc.c:236) ==7158== by 0x4F79D73: operator new(unsigned long) ( in /grid/fermiapp/nova/novaart/externals-0.2.0/art/v0_06_01/slf5.x86_$ ==7158== by 0x4F79E1F: operator new[](unsigned long) ( in /grid/fermiapp/nova/novaart/externals-0.2.0/art/v0_06_01/slf5.x8$ ==7158== by 0x9C415A6: TStringRef::GetRep(int, int) (TString.cxx:145) ==7158== by 0x9C42C57: TString::Replace(int, int, char const*, int) (TString.cxx:775) ==7158== LEAK SUMMARY: ==7158== definitely lost: 6,253 bytes in 65 blocks ==7158== indirectly lost: 418,233 bytes in 2,693 blocks ==7158== possibly lost: 881,436 bytes in 16,114 blocks ==7158== still reachable: 22,613,092 bytes in 101,826 blocks ==7158== suppressed: 0 bytes in 0 blocks ==7158== Reachable blocks (those to which a pointer was found) are not shown. ==7158== To see them, rerun with: --leak-check=full --show-reachable=yes ==7158== ==7158== For counts of detected and suppressed errors, rerun with: -v ==7158== ERROR SUMMARY: 1821 errors from 1821 contexts (suppressed: 2330 from 23) Leak 171kb possibly malloc funktion in file vg_replace_malloc.c on line 236 in /grid/fermiapp/nova/novaart/externals-0.2.0/art/v0_06_01/slf5.x86_$ Need to check? grid/fermiapp/nova/novaart/externals-0.2.0/art/v0_06_01/slf5.x86_$ 5

Memory leaking: correcting After first report main source of leaking has been identified and corrected (g4nova package). 6