如何衡量應用程序或進程的實際內存使用狀況? - How to measure actual memory usage of an application or process?

問題:

This question is covered here in great detail. 這個問題在這裏詳細介紹。 html

How do you measure the memory usage of an application or process in Linux? 您如何衡量Linux中應用程序或進程的內存使用狀況? linux

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent. 瞭解Linux上的內存使用的博客文章中, ps不是用於此目的的準確工具。 app

Why ps is "wrong" 爲何ps是「錯誤的」 工具

Depending on how you look at it, ps is not reporting the real memory usage of processes. 根據您的見解, ps不會報告進程的實際內存使用狀況。 What it is really doing is showing how much real memory each process would take up if it were the only process running . 它的真正做用是顯示若是每一個進程是惟一運行的進程每一個進程將佔用多少實際內存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong . 固然,一臺典型的Linux計算機在任何給定時間都運行着幾十個進程,這意味着ps報告的VSZ和RSS編號幾乎確定是錯誤的 this


解決方案:

參考一: https://stackoom.com/question/Y9n/如何衡量應用程序或進程的實際內存使用狀況
參考二: https://oldbug.net/q/Y9n/How-to-measure-actual-memory-usage-of-an-application-or-process
相關文章
相關標籤/搜索