3

I am looking to put something in my code so that I can force a Massif snapshot at certain points of its execution, for example in a server to dump out a massif snapshot to file between requests to see if I am holding onto a lot of memory between requests. I have not been able to spot a way whether it be macro or library call to force it to dump out a snapshot at that point is there anyway to do this?

Thanks

csteifel
  • 2,854
  • 6
  • 35
  • 61

1 Answers1

3

There 3 ways to ask massif to output a snapshot. They all go via a monitor request as documented in http://www.valgrind.org/docs/manual/ms-manual.html#ms-manual.monitor-commands

These monitor requests can be passed to massif 3 different ways:

  1. interactively, from a shell, using vgdb. E.g. vgdb snapshot

  2. interactively, from gdb, using gdb+vgdb. E.g. (gdb) monitor snapshot

  3. from your program, by using the valgrind client request VALGRIND_MONITOR_COMMAND("snapshot") or VALGRIND_MONITOR_COMMAND("detailed_snapshot")

daramarak
  • 6,115
  • 1
  • 31
  • 50
phd
  • 3,669
  • 1
  • 11
  • 12