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 byps
are almost definitely wrong . 固然,一臺典型的Linux計算機在任何給定時間都運行着幾十個進程,這意味着ps
報告的VSZ和RSS編號幾乎確定是錯誤的 。 this