Possible Duplicate:
Measuring RAM usage of a program
I am trying to use ps
to benchmark a program, I'm just not sure which flags to use. I would like to get the amount of RAM the program used in total, what flag should I use?
Possible Duplicate:
Measuring RAM usage of a program
I am trying to use ps
to benchmark a program, I'm just not sure which flags to use. I would like to get the amount of RAM the program used in total, what flag should I use?
ps axu|grep YOUR_PROCESS | grep -v grep|awk {'print $4'}
For applications that run with more than one instance, you would need to sum the total. You could use awk
to do this:
ps aux | awk '/YOUR_APP/ { sum+=$4 } END { print sum }'
ps
, see Mathematical connection between SZ RSS and VSZ in ps o/p? – Gilles 'SO- stop being evil' Sep 10 '12 at 00:00