Saturday, 14 December 2013

Checking memory usage for a set of processes

Recently, I had to monitor memory usage of a set of processes. I used pmap to help me out. The following script gave memory usage of each PID I was interested in.

for foo in `ps aux | grep <my_process_identifier> | awk -F ' ' '{print $2}'`
echo $foo
pmap $foo | tail -n 1

No comments: