解决方法
我最终为此编写了自己的实用程序:
https://gist.github.com/Eugeny/04ccfe8accf4bc74b0ca
我针对init(pid 1)运行它进行测试,报告的总数大致等于物理ram的使用情况(按照htop),所以我猜这有点正确.
使用示例:
~ » pstree -ap 15897 zsh,15897 └─sudo,9783 make rundev └─make,9784 rundev └─sh,9785 -c cd ajenti-panel && ./ajenti-panel -v --autologin --plugins ../plugins --dev └─python ./ajenti,9786 ├─./ajenti-panel,9834 ├─./ajenti-panel,9795 └─{python ./ajenti},9796 ~ » sudo ./memuse.py 15897 PID Commandline Frames (+unique) VMEM - 15897 (/usr/bin/zsh ): 1776 +1776 7104 KB - 9783 (sudo make rundev ): 608 +408 2432 KB - 9784 (make rundev ): 261 +98 1044 KB - 9785 (/bin/sh -c cd ajenti-panel && ): 166 +48 664 KB - 9786 (python ./ajenti-panel -v --aut): 9279 +8977 37116 KB - 9795 (./ajenti-panel worker [restric): 7637 +1334 30548 KB - 9834 (./ajenti-panel worker [session): 8972 +2639 35888 KB ---------------------------------------------------------------------------------------- TOTAL: 15280 61120 KB