This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory Dump


On Sat, 2012-05-05 at 17:55 -0700, Hei Chan wrote:
> Hi Phillippe,
> 
> The feature you mentioned sounds interesting.
> 
> Is it capable of taking heap snapshot per user request/command?
Yes. You can request a snapshot on user request,
either from the command line, or from a gdb connected to the Valgrind
gdbserver.

For gdbserver explanations, see
http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
For massif snapshot requests, see
http://www.valgrind.org/docs/manual/ms-manual.html#ms-manual.monitor-commands

So, from a shell command line, to request a massif snapshot, you do
e.g.:
    vgdb snapshot filename_for_your_snapshot

>From gdb connected to Valgrind gdbserver, you put breaks where relevant,
and then such a break is reached:
    monitor snapshot filename_for_your_snapshot

Note also that memcheck also provides on demand leak search
(including for still reachable blocks), showing the delta
with the previous leak search.

In 3.8.0 SVN (not yet released), Valgrind gdbserver+memcheck also
provides functionalities to list the still allocated blocks, and search
for "who" still points at these allocated blocks.

Philippe



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]