avatar
How to monitor peak memory usage?# Unix - 噫吁兮,危乎高哉
s*e
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.
avatar
c*r
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.

avatar
s*e
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.

avatar
t*s
4

you may use "sar"

【在 s******e 的大作中提到】
: Thank you very much for the reply.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。