Project

General

Profile

Valgrind

Valgrind is a versatile tool and highly recommended for anyone debugging applications under Linux.
You can use it to find bugs or hunt down performance bottlenecks.

Finding Memleaks / Bugs

Memcheck

Docs: http://valgrind.org/docs/manual/mc-manual.html

It is sometimes a little bit hard to find mem-leaks in glib based applications, so just use this:

G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full --show-reachable=yes --leak-resolution=high <yourapplication>

Critical Warnings

Abort on critical warnings:

G_DEBUG=fatal_criticals

Finding Bottlenecks

Use KCachegrind to visualize the outputs of Callgrind and Cachegrind.

Callgrind

Docs: http://valgrind.org/docs/manual/cl-manual.html

valgrind --tool=callgrind <yourapplication>

Cachegrind

Docs: http://valgrind.org/docs/manual/cg-manual.html

valgrind --tool=cachegrind <yourapplication>

Updated by stbuehler about 6 years ago · 4 revisions