How can I measure the actual memory usage of an application or process?

后端 未结 30 2682
心在旅途
心在旅途 2020-11-22 03:01

This question is covered here in great detail.

How do you measure the memory usage of an application or process in Linux?

From the blog articl

30条回答
  •  感情败类
    2020-11-22 03:43

    The below command line will give you the total memory used by the various process running on the Linux machine in MB:

    ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | awk '{total=total + $1} END {print total}'
    

提交回复
热议问题