How can I measure the actual memory usage of an application or process?
Asked 07 September, 2021
Viewed 801 times
  • 52
Votes

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

From the blog article of Understanding memory usage on Linux, ps is not an accurate tool to use for this intent.


Why ps is "wrong"

Depending on how you look at it, ps is not reporting the real memory usage of processes. 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.

(Note: This question is covered here in great detail.)

30 Answer