Yaroslav Akulov
Yaroslav Akulov

Reputation: 41

Using massif on process which is "killed 9"

I'm trying to do a memory profiling for a program which consumes too much memory and gets killed by OS (FreeBSD) with 9 signal. That happens on some specific data, so profiling it on another (e.g. smaller) data set would not give much help. When program is killed 9 massif doesn't generate any output at all. What could be done in this situation to get memory profiled?

Upvotes: 4

Views: 597

Answers (1)

phd
phd

Reputation: 131

If you have a recent Valgrind version (>= 3.7.0), Valgrind has an embedded gdbserver so it can be used together with gdb.

Before your application starts to run under Valgrind, you can put breakpoints. When a breakpoint is encountered, GDB monitor commands are available to invoke Valgrind tool specific functionalities. For example, with Massif, you can trigger the production of a report. With Memcheck, you can do a leak search, examine validity bits, ...

It is also possible to trigger these monitor commands from the shell command line (using the Valgrind vgdb utility)

Upvotes: 1

Related Questions