For a given process in
/proc/<pid>/smaps, for a given mapping entry what are:
Shared_Dirty the amount of memory that is shared with other processes? So it is like shared RSS?
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
Private_Dirty for every smaps entry for the process I get the RSS of the process as
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
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?
PSS= Proportional set size.
USS= Unique set size.