How To Install Valgrind In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

How To Install Valgrind In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

valgrind

Wrapper for a set of expert tools for profiling, optimizing and debugging programs.
Commonly used tools include `memcheck`, `cachegrind`, `callgrind`, `massif`, `helgrind`, and `drd`.

Maintainer: Alessandro Ghedini



Section: devel

Install valgrind

  • Debian apt-get install valgrind Click to copy
  • Ubuntu apt-get install valgrind Click to copy
  • Alpine OS apk add valgrind Click to copy
  • Arch Linux pacman -S valgrind Click to copy
  • Kali Linux apt-get install valgrind Click to copy
  • CentOS yum install valgrind-1 Click to copy
  • Fedora dnf install valgrind-1 Click to copy
  • Raspbian apt-get install valgrind Click to copy
  • macOS brew install valgrind Click to copy

Wrapper for a set of expert tools for profiling, optimizing and debugging programs. Commonly used tools include `memcheck`, `cachegrind`, `callgrind`, `massif`, `helgrind`, and `drd`.

How to use valgrind?

Below are few example commands for valgrind that you can use in the terminal.

Use the (default) Memcheck tool to show a diagnostic of memory usage by `program`:
valgrind programClick to copy
Use Memcheck to report all possible memory leaks of `program` in full detail:
valgrind --leak-check=full --show-leak-kinds=all programClick to copy
Use the Cachegrind tool to profile and log CPU cache operations of `program`:
valgrind --tool=cachegrind programClick to copy
Use the Massif tool to profile and log heap memory and stack usage of `program`:
valgrind --tool=massif --stacks=yes programClick to copy
Install the latest version of valgrind in Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS from terminal. To install the valgrind just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of valgrind from the respository and install it in your computer/server.