valgrind allows the programmer to run the executable inside its own environment in which it checks for unpaired calls to malloc and other uses of invalid memory (such as ininitialized memory) or invalid memory operations (such as freeing a block of memory twice or calling the wrong deallocator function)

valgrind does not check usage of statically allocated arrays (allocated on the stack)

what's the drawback of using valgrind? it's going to consume more memory - up to twice as much as your program normally does. if you're testing an absolutely huge memory hog, you might have issues

detecting the use of uninitialized variables

$> valgrind --tool=memcheck --leak-check=yes -q progname


helgrind ...

cachegrind ...

finding memory leaks


finding invalid pointer