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
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:
interactively, from a shell, using vgdb. E.g. vgdb snapshot
interactively, from gdb, using gdb+vgdb. E.g. (gdb) monitor snapshot
from your program, by using the valgrind client request VALGRIND_MONITOR_COMMAND("snapshot") or VALGRIND_MONITOR_COMMAND("detailed_snapshot")