Using Valgrind

More Information

Valgrind Home Page

Installation

Install valgrind using yum:

sudo yum -y install valgrind

Basic Memcheck Usage

valgrind \
         --tool=memcheck \
         --num-callers=20 \
         --log-file=vg.log \
         --leak-check=full \
         --show-reachable=yes \
[command-and-args]

Using Suppressions

valgrind --tool=memcheck \
         --num-callers=50 \
         --log-file=vg.log \
         --leak-check=full \
         --trace-children=yes \
         --gen-suppressions=all \
         --suppressions=../valgrind.supp \
[command-and-args]

# sample suppression
{
   PyObject_Free_invread
   Memcheck:Value4
   fun:PyObject_Free
   obj:/usr/lib/libpython2.4.so.1.0
}

Here are some suppression files that I sometimes use:

ACE.supp
TAO.supp
db4.supp
openssl.supp