【问题标题】:How can I grap resident set size from Python on Solaris?如何在 Solaris 上从 Python 获取驻留集大小?
【发布时间】:2010-02-01 21:17:11
【问题描述】:

从 Python 调用 resource.getrusage() 会在 Solaris 和 Linux 系统上为驻留集大小返回 0 值。在 Linux 上,您可以改为从 /proc//status 提取 RSS。有没有人有一个在 Solaris 上提取 RSS 的好方法,类似于或不类似于 Linux 解决方法?

【问题讨论】:

    标签: python solaris getrusage


    【解决方案1】:

    嗯...您可以通过调用 pmap -x 从 pmap 应用程序中提取它。但我正在寻找更多方法来从我的应用程序中直接访问 /proc 中的信息。唯一的方法是访问 /proc//xmap 文件。不幸的是,数据存储为 prxmap 结构的数组......所以要么是 Python C 模块,要么是使用 ctypes 模块。当我写到其中一个时,我会发布更新。

    【讨论】:

      【解决方案2】:

      也许在/proc 下使用Solaris 的psinfo? (solaris proc(4) docs)

      【讨论】:

        猜你喜欢
        • 2012-05-11
        • 2011-03-03
        • 2020-07-01
        • 2020-12-21
        • 1970-01-01
        • 2014-02-07
        • 2014-07-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多