C++ Study Valgrind Valgrind is an instrumentation framework for building dynamic analysis tools. see here # install sudo apt-get install valgrind # usage valgrind --tool=memcheck --leak-check=yes ./a.out Disassembly g++ -c -o main main.cc objdump -d main