#安装 valgrind sudo apt-get install valgrind #使用 memcheck 打开程序 valgrind --tool=memcheck myprogram [args...]