1 / 8

TotalView Memory Debugging

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

sbranch
Download Presentation

TotalView Memory Debugging

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Matt WolfeLC Development Environment GroupLawrence Livermore National Laboratory TotalView Memory Debugging 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 LLNL-PRES-426092

  2. 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. 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. 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. 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. 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. 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. TVTech Memory Debugging Resources • On-screen help • Help menu • '?' button • Tips menu • CLI: help dheap

More Related