SPI Quick Links
SPI Services Links
LCG App. Area
How to use Valgrind
Tips and Notes
Valgrind is a GPL'd tool to help you find memory-management problems
in your programs. When a program is run under Valgrind's supervision,
all reads and writes of memory are checked, and calls to malloc/new/free/delete
are intercepted. As a result, Valgrind can detect problems
In addition, a satellite program, cachegrind, can be used for processor-level (simulated) cache analysis.
For more information look at the Valgrind Homepage.
How to use ValgrindValgrind is installed at CERN in the LCG external area. Currently version 1.04 is installed and only for Linux redhat72.
In order to use you have to set your path to :
Then just run your application, but place the word valgrind
in front of your usual command-line invocation.
valgrind ls -l
Note that you should run the real (machine-code) executable here. If
your application is started by, for example, a shell or perl script, you'll
need to modify it to invoke Valgrind on the real executables. Running
such scripts directly under Valgrind will result in you getting error
The output of Valgrind consists of adding some commentary text to the
program output, reporting for example errors.
where 12345 is the process ID. This scheme makes it easy to distinguish
program output from Valgrind commentary.
Tips and NotesIn order to get more information from Valgrind, build the code you analyse with debugging information. It is not required, but if you recompile your modules with the "-g" option, Valgrind will tell you exactly the line where the error occurred.
Valgrind reports only unique errors. After certain number of errors is
reached, Valgrind begins to suppress errors. After even more errors,
Last modified: Tue Nov 5 CET 2002
$Revision: 1.10 $ $Author: aimar $