0Pricing
C++ Academy · Lesson

Valgrind Basics

Detect leaks and errors.

What Is Valgrind?

Valgrind is an instrumentation framework. Its default tool, Memcheck, detects memory leaks and errors without recompiling, by running your program on a synthetic CPU.

Running Memcheck

Invoke Valgrind in front of your program. Build with -g first for line numbers.

g++ -g main.cpp -o app
valgrind --leak-check=full ./app

All lessons in this course

  1. Using gdb and lldb
  2. AddressSanitizer
  3. UBSan and TSan
  4. Valgrind Basics
← Back to C++ Academy