Home

Valgrinds

Valgrind is a dynamic instrumentation framework used for building debugging and profiling tools for memory and threading errors in native programs. It executes programs on its own synthetic machine, instrumenting memory accesses, allocations, and function calls at runtime. Valgrind is free software released under the GNU General Public License and is maintained by a community of contributors.

The suite comprises several tools commonly referred to as Valgrind tools. Notable components include Memcheck, which

Usage generally involves invoking the Valgrind runner with a selected tool, for example: valgrind --tool=memcheck --leak-check=full

Limitations include substantial slowdown and increased memory usage, making it unsuitable for production runs. Support spans

Valgrind was created by Julian Seward in 2000 and is released under the GPL. It is widely

detects
memory
management
and
usage
errors
(such
as
use-after-free,
invalid
reads
and
writes,
and
leaks);
Helgrind,
which
detects
data
races
in
multi-threaded
programs;
Cachegrind,
which
models
CPU
caches
to
estimate
cache
misses;
Massif,
a
heap
profiler;
and
Callgrind,
which
records
call
graphs
for
performance
analysis.
--show-leak-kinds=all
./program
[args].
Other
tools
are
selected
with
--tool=cachegrind,
--tool=massif,
or
--tool=helgrind.
Options
can
control
reporting
detail
and
performance,
such
as
--track-origins
for
uninitialized
memory
and
--log-file.
Linux
and
several
Unix-like
systems,
but
portability
to
Windows
and
some
macOS
variants
varies,
and
some
languages
or
environments
(notably
those
with
aggressive
JIT
or
non-native
code)
may
be
less
compatible.
used
for
debugging
and
profiling
in
C,
C++,
and
Fortran
projects.