Presentation is loading. Please wait.

Presentation is loading. Please wait.

Matt Wolfe LC Development Environment Group Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory, P. O. Box 808, Livermore, CA.

Similar presentations


Presentation on theme: "Matt Wolfe LC Development Environment Group Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory, P. O. Box 808, Livermore, CA."— Presentation transcript:

1 Matt Wolfe LC Development Environment Group Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory, P. O. Box 808, Livermore, CA 94551 This work performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344 TotalView Memory Debugging LLNL-PRES-426092

2 Lawrence Livermore National Laboratory TotalView Memory Debugging Value-Adds  See allocation detail on variable display  Display heap block contents  Compare memory usage and heap across processes or times  Records stack trace at points of allocation/deallocation  Reports block and byte counts by unique stack trace  Automatically catches selected memory use errors  Graphically displays the heap  Assists heap corruption debugging

3 Lawrence Livermore National Laboratory Preparing Code and Invoking TotalView (TV) Memory Debugging  Build as you would for TV debugging  Link with the Heap Interposition Agent (HIA) if necessary For stand-alone runs and to attach to running code For core file memory debugging For certain platforms and link methods  Start code under TV: use mtv in place of totalview, or totalview -memory_debugging -no_mem_notify_events  Attach to and inspect running code+HIA  Post mortem core file inspection of code+HIA

4 Lawrence Livermore National Laboratory Memory Debugging Basics  HIA runs and records data in user's process space  Browser-style user interface  Work with selected processes or groups, stop on event  Chart memory usage by memory type and by process or library  Display list of current allocations  Display stack trace at allocation/deallocation  Save and share some reports as HTML  Save memory data for later comparison

5 Lawrence Livermore National Laboratory Heap Debugging Assists  Heap block end guards catch out-of-bounds array writes  "Red Zone" end guards immediately catch by page faults  Block painting catches read-before-write and read-after-deallocation bugs  Deallocation hoarding identifies late-read bugs  Graphical view shows memory regions and nearby blocks

6 Lawrence Livermore National Laboratory Memory Debugging Power Tools  Memory leak report  Filter out files you have no control over  Sort to focus on worst offenders  Report heap blocks by stack trace or source line  Report corrupted memory  Set baseline and compare memory to baseline  Compare memory of different processes from multiple runs  memscript

7 Lawrence Livermore National Laboratory Automatic Event Notifications  Report most recent event per process  Report processes stopped at the same event  Notify [re-]allocation failures  Notify alignment errors  Notify de/re-allocation of a specific block  Notify deallocation with corrupted end guard  Notify Red Zone events including use after free  Notify code exit

8 Lawrence Livermore National Laboratory TVTech Memory Debugging Resources  On-screen help  Help menu  '?' button  Tips menu  CLI: help dheap


Download ppt "Matt Wolfe LC Development Environment Group Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory, P. O. Box 808, Livermore, CA."

Similar presentations


Ads by Google