Forrest logo
back to the valgrind tool

valgrind:tldr:d7e47

valgrind: Use Memcheck to report all possible memory leaks of `program` in full detail.
$ valgrind --leak-check=full --show-leak-kinds=all ${program}
try on your machine

The command "valgrind --leak-check=full --show-leak-kinds=all ${program}" is a command used with the valgrind tool, which is a memory debugging and profiling tool for Linux.

  • "valgrind" is the name of the tool itself.
  • "--leak-check=full" is an option that tells valgrind to perform a thorough check for memory leaks. It tracks allocations and deallocations of memory and reports any memory blocks that are not deallocated.
  • "--show-leak-kinds=all" is an option that specifies the kinds of memory leaks to be shown. In this case, it will show all the different kinds of possible memory leaks, including definite, indirect, possible, and reachable leaks.
  • "${program}" is a placeholder that represents the name or path of the program you want to analyze with valgrind. It should be replaced with the actual name or path of the program you want to test for memory leaks.

By running this command, valgrind will check the specified program for memory leaks, providing detailed information about the memory blocks that are potentially leaked, along with the stack traces, memory addresses, and other useful debugging information.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the valgrind tool