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

后端 未结 30 3099
心在旅途
心在旅途 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:53

    Note: this works 100% well only when memory consumption increases

    If you want to monitor memory usage by given process (or group of processed sharing common name, e.g. google-chrome, you can use my bash-script:

    while true; do ps aux | awk ‚{print $5, $11}’ | grep chrome | sort -n > /tmp/a.txt; sleep 1; diff /tmp/{b,a}.txt; mv /tmp/{a,b}.txt; done;
    

    this will continuously look for changes and print them.

    Enter image description here

提交回复
热议问题