How to Measure memory consumption (using google-perftools)

From KratosWiki
Revision as of 17:28, 7 April 2013 by Rrossi (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here we assume that the "google-perftools" are correctly installed in the system under the directory "/usr/lib". The following instructions shall be changed to reflect the actual installation directory for such libraries

let's now imagine we wish to profile the "cavity2D" example of the "incompressible_fluid_application". We shall first of all preload the libraries needed

  export LD_PRELOAD=/usr/lib/

secondarily we shall activate the profiler instructing on where to dump the data and which file shall be run. this is obtained by setting the environmental var HEAPPROFILE in "/tmp/cavity_prof" we shall write

  HEAPPROFILE=/tmp/cavity_heap python

After this step the file "/tmp/cavity_prof" exists in the system. Such file need to be interpreted by the program "pprof" or "google-pprof" under ubuntu. PDF output can be obtained by

  google-pprof --pdf /usr/bin/python /tmp/cavity_prof.0001 > profiling_output.pdf

which dumps the profiling output to the file named "profiling_output.pdf". Similarly text output is obtained by

  google-pprof --text /usr/bin/python /tmp/cavity_prof.0001 > profiling_output.txt
Personal tools