https://yq.aliyun.com/articles/54405?commentId=9029
在linux中有一个工具叫smem,其实就是通过smaps来统计的。
PSS是Pss的相加
USS则是Private的相加
PSS是Pss的相加
USS则是Private的相加
yum install -y smem smemstat
smem can report proportional set size (PSS), which is a more meaningful representation of the amount of memory used by libraries and applications in a virtual memory system.
Because large portions of physical memory are typically shared among multiple applications, the standard measure of memory usage known as resident set size (RSS) will significantly overestimate memory usage. PSS instead measures each application's "fair share" of each shared area to give a realistic measure.
https://blog.csdn.net/adaptiver/article/details/7084364
Terms
- VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
- RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存)
- PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
- USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS
smem
PID User Command Swap USS PSS RSS
23716 digoal postgres: postgres postgres 0 4924 5387 7040
对应的RSS, PSS, USS分别等于以下相加.
# cat /proc/23716/smaps | grep Rss
# cat /proc/23716/smaps | grep Pss
# cat /proc/23716/smaps | grep Private_
没有评论:
发表评论