【问题标题】:How does smem calculate RSS, USS and PSS?smem如何计算RSS、USS和PSS?
【发布时间】:2015-06-17 11:47:40
【问题描述】:

现在,我正在尝试编写一个程序,该程序应该确定类似于smem的单个进程的内存使用情况,但没有smem那么花哨。但我想知道 smem 如何确定 USS、PSS 和 RSS 的值。如果能详细解释如何接收必要的信息,我将不胜感激。

【问题讨论】:

    标签: linux memory memory-management


    【解决方案1】:

    您可以简单地查看源代码。它是用 python 编写的。
    基本上,

    USS = sum of /proc/<pid>/smaps Private_clean + Private_dirty
    PSS = sum of /proc/<pid>/smaps Pss
    RSS = sum of /proc/<pid>/smaps Rss
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-17
      • 1970-01-01
      • 2012-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多