Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Linux Tools Project/Valgrind/User Guide"

(Using Massif)
(Using Massif)
Line 26: Line 26:
 
== Using Massif ==
 
== Using Massif ==
 
* Massif is heap profiling tool that details memory usage throughout your program's execution. (see: http://www.valgrind.org/docs/manual/ms-manual.html)
 
* Massif is heap profiling tool that details memory usage throughout your program's execution. (see: http://www.valgrind.org/docs/manual/ms-manual.html)
* Switching tool
+
* To use Massif, you need to switch the tool in your profile configuration.
* Interpreting Output
+
* Massif has a lot of output to distil. There are 3 ways to view the data.
** Table viewer
+
** The Valgrind view shows statistics for each unit of time (default: instructions) in the program.
 
*** Interactivity
 
*** Interactivity
 
** Tree viewer
 
** Tree viewer

Revision as of 13:59, 13 May 2009

Overview

  • Valgrind is a powerful and widely used memory profiling tool suite. (http://www.valgrind.org)
  • This project aims to provide a useful integration of Valgrind tools with your Eclipse projects.
  • Currently Memcheck, Massif and Cachegrind are supported.
  • Valgrind 3.3.0 or greater is required.

Installing

Using Memcheck

  • Memcheck discovers memory management problems in your program. (http://www.valgrind.org/docs/manual/mc-manual.html)
  • It is the default tool.
  • The launch shortcut can create a configuration with default options for your program.
    • Same as running valgrind ./myprog from the command line.
    • After a configuration has already been created, the launch shortcut will launch your most recently used configuration.
  • Any memory management errors reported by Valgrind are listed in the Valgrind view, which should appear automatically.
    • Each error has a stack trace.
    • If the source can be resolved, double-clicking on the stack frame will open an editor to its line.
  • View and modify your profile configuration by selecting "Profile Configurations".
    • All Valgrind related configuration options can be changed from the Valgrind Options tab.
    • General options and Suppressions are Valgrind core options and are not related to the tool being run.
    • Details on Memcheck suppressions can be found here.
    • Specific Memcheck options can also be configured.

Using Massif

  • Massif is heap profiling tool that details memory usage throughout your program's execution. (see: http://www.valgrind.org/docs/manual/ms-manual.html)
  • To use Massif, you need to switch the tool in your profile configuration.
  • Massif has a lot of output to distil. There are 3 ways to view the data.
    • The Valgrind view shows statistics for each unit of time (default: instructions) in the program.
      • Interactivity
    • Tree viewer
      • Interactivity
    • Chart
      • Interactivity
  • Config Options

Using Cachegrind

  • Link to valgrind.org doc
  • Switching tool
  • Interpreting Output
    • Interactivity

Special Cases

  • Handling program errors
  • Handling Valgrind config errors

Back to the top