I want to watch a given process in unix over time to see what time memory grows (its a long running job)
I guess I could do
ps -aux | grep PID
and run this from cron every 5 minutes, but it seems there should be a better way.
Is there a way I can use sar to do this?
I use the following:
$ ps -o rss $(pgrep executablename)
Put that in a while loop or use watch to monitor it over time coupled with tail. You can also tee it to a file and have gnuplot plot it for you and refresh it every few seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With