I am using Valgrind
with the massif
tool to monitor all parts of code that memory allocation occurs. In this case, I used this command to run my program using Valgrind
:
valgrind --tool=massif --vgdb=full --pages-as-heap=yes --detailed-freq=1 --threshold=0.001 --max-snapshots=100 --time-unit=ms ./myprogram
My problem is that after 30 mins of running the program, it starts allocating more memory. I want to monitor that which parts of the code are allocating memory. I should notice that this is not a memory leak so I didn't use Memcheck
rather I used massif
. This command takes snapshots from memory at the beginning but after that, I have no snapshots from memory.
To solve this problem I used the vgdb
command to take detailed snapshots in the way below:
vgdb detailed_snapshot
But looks like this command is using the captured snapshot, not a new one. So how can I take a new snapshot when I want? Or should I release the captured snapshot in some way?