how to monitor a processes memory usage over time - ubuntu [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this questionI want to watch a given process in unix over time to see what time memory grows (its a long running job)开发者_StackOverflow社区
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.
精彩评论