Valgrind
Valgrind can detect common errors such as:
- Reading/writing freed memory or incorrect stack areas.
- Using values before they have been initialised.
- Incorrect freeing of memory, such as double freeing heap blocks.
- Misuse of functions for memory allocations: new(), malloc(), free(), deallocate(), etc.
- Memory leaks - unintentional memory consumption often related to program logic flaws which lead to loss of memory pointers prior to deallocation.
- Overlapping source and destination pointers in memcpy() and related functions.
Valgrind also provides different profiling tools: Cachegrind, Callgrind and Massif. This tutorial discusses only the Memcheck tool. For full documentation make reference to the Valgrind User Manual.
Compilation | Parallel Versions |
Running | Reporting of Errors |
Suppressing Errors | Useful Options |