http://www.valgrind.org/
https://www.ibm.com/developerworks/cn/linux/l-cn-valgrind/index.html
Valgrind是一套Linux下,开放源代码(GPL
V2)的仿真调试工具的集合。Valgrind由内核(core)以及基于内核的其他调试工具组成。内核类似于一个框架(framework),它模拟了一个CPU环境,并提供服务给其他工具;而其他工具则类似于插件
(plug-in),利用内核提供的服务完成各种特定的内存调试任务。
valgrind --leak-check=full --log-file=valgrind.log --show-reachable=yes --trace-children=yes --track-origins=yes your_command
分为core options (通用)和针对某类工具的参数。
http://www.valgrind.org/docs/manual/manual-core.html#manual-core.basicopts
--leak-check
--log-file
--show-reachable
--tracd-children
--track-origins