Question

How can I send a signal to my process which runs inside valgrind to check its memory usage status?

Thanks!

Was it helpful?

Solution

To send a signal to valgrind, pkill -USR1 valgrind doesn't want to work for me.

pkill -USR1 memcheck

do the trick.

OTHER TIPS

There is not a signal that tells valgrind to check its memory usage status. If you are interested in the amount of memory used by your program over time and where that memory is allocated, valgrind's massif tool can record that information, which can then be displayed using its ms_print utility. Massif records snapshots of the program's memory usage automatically throughout the execution of the program, including a peak snapshot representing the point at which the memory usage was at its peak (within 1% using the default options).

To run your program under valgrind's massif tool:

valgrind --tool=massif yourprogram

A binary file massif.out.pid will be created. Use ms_print to format the information in text form:

ms_print massif.out.12345
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top