W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Memory Profiling using Valgrind’s Massif Tools for Software Development living knowledge WWU Münster Andreas Buhr 23. Oktober 2013
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Using Massif 2 /6 What is Valgrind? living knowledge WWU Münster www.valgrind.org , , Andreas Buhr
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Using Massif 3 /6 What is Valgrind? ◮ CPU simulator executing the program ◮ ... has a tool for runtime profiling ◮ ... has a tool to find race conditions living knowledge ◮ ... has a tool to find memory leaks WWU Münster ◮ ... has a tool to profile memory usage (tool massif) , , Andreas Buhr
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Using Massif 4 /6 How to profile memory usage ◮ sudo apt-get install valgrind ◮ g++ -g -o myprog myprog.cpp ◮ valgrind --tool=massif ./myprog living knowledge ◮ ms_print massif.out.<pid> WWU Münster , , Andreas Buhr
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Using Massif 5 /6 Live Demo living knowledge WWU Münster , , Andreas Buhr
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Using Massif 6 /6 Homework: try it ◮ take any executable with debug symbols ◮ run “valgrind --tool=massif ./myprog” living knowledge ◮ ms_print massif.out.<pid> WWU Münster , , Andreas Buhr
Recommend
More recommend