s******e 发帖数: 273 | 1 Currently I use "top". However, is there any way to
capture it into a file so that I can read it later.
This is because I need to run a batch of jobs by a script.
I can't monitor all of them. I want to have a program
do it automatically and write the peak memory usage for
each of the job to a file.
Thanks. | c*r 发帖数: 278 | 2 "top" in batch mode (option "-b") can be redirected to a file.
But in order to do what you want, you have to invoke "top" repeatedly.
A simple but ugly way: write a shell script, call "top" periodically
and ">>" output to a file. You can filter out unwanted lines.
On systems that support /proc, you can write your own program to read
the /proc//status file and keep track the peak usage.
【在 s******e 的大作中提到】 : Currently I use "top". However, is there any way to : capture it into a file so that I can read it later. : This is because I need to run a batch of jobs by a script. : I can't monitor all of them. I want to have a program : do it automatically and write the peak memory usage for : each of the job to a file. : Thanks.
| s******e 发帖数: 273 | 3 Thank you very much for the reply.
【在 c*r 的大作中提到】 : "top" in batch mode (option "-b") can be redirected to a file. : But in order to do what you want, you have to invoke "top" repeatedly. : A simple but ugly way: write a shell script, call "top" periodically : and ">>" output to a file. You can filter out unwanted lines. : On systems that support /proc, you can write your own program to read : the /proc//status file and keep track the peak usage.
| t*****s 发帖数: 3478 | 4
you may use "sar"
【在 s******e 的大作中提到】 : Thank you very much for the reply.
|
|