Reputation: 1530
I am running an executable in linux (c++ code). I want to calculate 'average' working set size of this executable? I have no clue in how to proceed. Can some one help me out?
Is there any command in linux to do so?
Thanks in advance
Upvotes: 0
Views: 1863
Reputation: 31461
Inspired by Caesar:
pid=`ps axo 'pid,ucomm' | grep procname | awk '{print $1;}'`
while sleep 15; do grep VmRSS /proc/$pid/status || break; done > /tmp/size
awk '{ sum += $2; count++; } END { print sum/count; }' /tmp/size
Upvotes: 3