DevOps

Valgrind – memory debugging and profiling framework

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
LLDBNext generation, high-performance debugger
GhidraSoftware reverse engineering framework
DelveSource level debugger for the Go programming language
GDBThe GNU Debugger
ValgrindA memory debugger and profiler
Radare2Portable reversing framework
BugStalkerRust debugger
XdebugExtension for PHP to aid debugging and development
SeerGUI frontend to GDB
iaitoGraphical interface for radare2
KDbgGraphical user interface to GDB
straceDiagnostic, debugging and instructional userspace utility
rrRecord-and-replay debugger
gfLightweight GDB interface with source, stack and memory views
drgnProgrammable debugger that puts scripting at the centre
cgdbLightweight console frontend to the GNU debugger
PuDBConsole-based visual debugger for Python
nndPartially inspired by RemedyBG
bashdbSource-code debugger for bash; follows the GDB command syntax
PINCEMemory scanning, process manipulation and reverse engineering
edbLow-level debugging with disassembly and register inspection
SysprofProfile an application or entire system
crashLinux kernel crash analysis utility

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted