Search code examples
linuxvalgrindpmap

Monitoring Valgrind with pmap


I am trying to monitor memory usage of a process with both Valgrind and pmap.

Since the process is not run by itself but through Valgrind, is it safe to say that monitoring Valgrind with pmap would be the same as monitoring the process, or does Valgrind use additional memory?

Thanks.


Solution

  • Depending on the tool, valgrind can use a lot more memory than a native run. Even the "none" tool uses more memory.

    Various valgrind tools can do a detailed monitoring/reporting of the memory used by your application.

    You might e.g. use the memcheck tool with --xtree-memory=full and visualise the resulting file with kcachegrind. See e.g. https://www.valgrind.org/docs/manual/manual-core.html#manual-core.xtree for more details.

    The massif tool can be used to report peaks of memory usages.