Valgrind is a framework offering programming tools for code profiling and memory debugging.

Some Valgrind tools that are nice to know:

Memcheck Use this to locate memory usage problems.

valgrind -tool=memcheck myProgram

It warns about reading/writing memory after it has been freed, uninitialised variables, memory leaks, ...


A tool for performance analysis of your code.

It records the call history among functions in a program.

valgrind -tool=callgrind myProgram

The generated output can e.g. be used to get a summanry of CPU cost of individual functions.

callgrind_annotate [options]

To visualise the callgrind output, there's also a GUI you can use: kcachegrind

ComputingValgrind (last edited 2015-02-20 22:50:27 by AnnikaVauth)