Valgrind is an instrumentation framework for debugging and profiling programs. It is particularly valuable when investigating memory corruption, memory leaks and other errors that can cause unpredictable behaviour in C and C++ applications.
Rather than being a single debugger, Valgrind provides a collection of specialised analysis tools. These examine different aspects of a program’s execution, from memory allocation and thread synchronisation to cache behaviour and function-call costs.
Valgrind operates directly on compiled executables, although programs built with debugging symbols produce more useful diagnostic information. Its detailed reports can help locate faults that are difficult to reproduce or identify through conventional debugging.
This is free and open source software.
Key Features
- Memcheck detects invalid memory accesses, use of uninitialised values, double frees and mismatched allocation and deallocation.
- Identify memory leaks and obtain stack traces showing where problematic allocations originated.
- Cachegrind analyses instruction execution, cache behaviour and branch prediction to identify potential performance problems.
- Callgrind collects call-graph and profiling information to reveal expensive execution paths.
- Massif profiles heap usage over time, identifying memory consumption and the allocations responsible.
- Helgrind detects data races, lock-order problems and misuse of POSIX threading primitives.
- DRD provides another approach to detecting data races and threading errors.
- DHAT examines heap allocations and their patterns of use, including how frequently allocated data is accessed.
- Generate detailed diagnostic reports that can be used alongside tools such as KCachegrind.
Website: valgrind.org
Support: Manual
Developer: Valgrind Developers
License: GNU General Public License v2.0
Valgrind is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| Debuggers | |
|---|---|
| LLDB | Next generation, high-performance debugger |
| Ghidra | Software reverse engineering framework |
| Delve | Source level debugger for the Go programming language |
| GDB | The GNU Debugger |
| Valgrind | A memory debugger and profiler |
| Radare2 | Portable reversing framework |
| BugStalker | Rust debugger |
| Xdebug | Extension for PHP to aid debugging and development |
| Seer | GUI frontend to GDB |
| iaito | Graphical interface for radare2 |
| KDbg | Graphical user interface to GDB |
| strace | Diagnostic, debugging and instructional userspace utility |
| rr | Record-and-replay debugger |
| gf | Lightweight GDB interface with source, stack and memory views |
| drgn | Programmable debugger that puts scripting at the centre |
| cgdb | Lightweight console frontend to the GNU debugger |
| PuDB | Console-based visual debugger for Python |
| nnd | Partially inspired by RemedyBG |
| bashdb | Source-code debugger for bash; follows the GDB command syntax |
| PINCE | Memory scanning, process manipulation and reverse engineering |
| edb | Low-level debugging with disassembly and register inspection |
| Sysprof | Profile an application or entire system |
| crash | Linux kernel crash analysis utility |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.