RSS, PSS and USS
We can use smem
to see physical memory and swap usage of each processes. Install smem
under ubuntu is easy:
sudo apt update
sudo apt install smem
Basically this tool collect informations from /proc/<pid>/maps
There are 3 metrics: RSS, PSS and USS[1]:
RSS
RSS = resident set size
It counts process's memory usage include shared libraries multiple times if they are used by different processes.
PSS
PSS = proportional set size
PSS is an enhanced metric that accounts for shared memory more accurately than RSS. It divides the shared memory by the number of processes sharing it and adds this fraction to the USS to provide a more realistic figure.
It helps in understanding the memory distribution among processes more fairly.
USS
USS = unique set size
It counts process's memory usage exclude shared libraries. This metrics is helpful how this process consumes physical memory at runtime.