valgrind is an open-source profiling tool for Linux that tracks the memory and CPU usage of your code, and detects a variety of run time errors.