Reputation: 29
I am using the massif tool in Valgrind. I need to track the heap memory of child process. I couldn't find any command to get the heap memory of child process. My application is a demon server.
In memcheck tool i can able to get the child process details by using
--track-children=yes
Is there any way to track the child process heap memory using massif ??
The tool creates the log file for all the child process, but it generates the massif file only for the main process.
valgrind \
--tool=massif \
--heap=yes \
--time-stamp=yes \
--time-unit=ms \
--max-snapshots=1000 \
--detailed-freq=5 \
--log-file=../Valgrind_%p_massif.log \
--massif-out-file=../masssif_%p_output \
--xtree-memory=full \
<binary_name>
I expect the massif file will be generated for all the child process. but it creates only one file foe the main process.
I checked the file last access time. It is the time the main process execution time till waiting for request.
Upvotes: 1
Views: 1009
Reputation: 3807
You are missing the option --trace-children=yes
--trace-children is not a memcheck specific option, it is a general valgrind option that must be used with any valgrind tool, if you want the children processes to also run under valgrind after exec.
Upvotes: 1