Valgrind

From LQWiki
Jump to: navigation, search

valgrind is a debugging program that can be used to trace all kinds of memory allocation errors, like memory leaks.

Example Usage

The following will run the program "a.out" and check it for memory errors:

$valgrind --tool=memcheck --leak-check=full -v a.out


Related Commands

These all relate to running commands in an altered context.

  • chroot - Confine the program to "jail".
  • env - Change variables.
  • nice - Change priority.
  • nohup - Protect from hangups (modem) or network outages.
  • stdbuf - Change buffering of standard I/O filestreams.
  • su - Change user
  • timeout - Limit the time.
  • strace - Create a log of system calls.

See also

External links