采集数据
valgrind --tool=massif ./test 检测栈上内存
valgrind --tool=massif --pages-as-heap=yes ./test 把pages上内存影射到栈上
valgrind --tool=callgrind ./test 单线程检测堆上内存
valgrind --tool=callgrind --separate-threads=yes ./test 多线程检查堆上内存
画图
产生dot
./gprof2dot.py -f callgrind callgrind.out.6408-13 > 13.dot
产生svg
dot -Tsvg 13.dot -o 13.svg
查考网站
http://www.graphviz.org/
http://valgrind.org/