For a given process in /proc/<pid>/smaps
, for a given mapping entry what are:
- Shared_Clean
- Shared_Dirty
- Private_Clean
- Private_Dirty
Is Shared_Clean
+ Shared_Dirty
the amount of memory that is shared with other processes? So it is like shared RSS?
Similarly is Private_Clean
+ Private_Dirty
the amount of memory that is available for only one process? So it is like private RSS?
Is the PSS value = PrivateRSS + (SharedRSS / number of processes sharing it)?
Some more questions after reading this link: LWN
Now lets talk about the process as a whole, whose smaps entry we are looking at.
I noticed that if I do Shared_Clean
+ Shared_Dirty
+ Private_Clean
+ Private_Dirty
for every smaps entry for the process I get the RSS of the process as
reported by ps
, which is pretty cool. For e.g.
ps -p $$ -o pid,rss
Will give me the (approx) same value for rss as the sum of every Shared_Clean
, Shared_Dirty
, Private_Clean
, Private_Dirty
entry in /proc/$$/smaps.
But what about PSS for the entire process? So, from the example above how do I get the PSS for $$ ? Can I just add the PSS entry for every smaps mapping and arrive at PSS for $$ ?
And what about USS for the entire process? Again taking the example above I am guessing that I can arrive at the USS for $$ by summing up only the Private_* entries for every smaps entry for $$..right?
Notes:
PSS= Proportional set size.
USS= Unique set size.
Shared_Dirty
- could you clarify your question? – Mat Jun 18 '13 at 04:26js
processes started up vianode
, if I want to know how much RAM would be freed if they were to be stopped, am I correct in interpreting thesmaps
metrics in the following manner: max potential freed RAM would be the sum of PSS values and the min freed RAM would be the sum of private pages (dirty+clean)? – one-liner Jan 24 '19 at 10:23