ps_mem

A utility to accurately report the in core memory usage for a program

Github星跟蹤圖

ps_mem

A utility to accurately report the core memory usage for a program

Yes the name is a bit weird. coremem would be more appropriate,
but for backwards compatible reasons the ps_mem name remains.

Install:

pip install ps_mem is supported, or rpm and deb packages
are available for most distros. Also the ps_mem.py script
can be run directly.

Usage:

ps_mem [-h, --help] [-p PID,...] [-s, --split-args] [-t, --total] [-w N]
       [-d, --discriminate-by-pid] [-S, --swap]

Example output:

 Private  +   Shared  =  RAM used       Program

 34.6 MiB +   1.0 MiB =  35.7 MiB       gnome-terminal
139.8 MiB +   2.3 MiB = 142.1 MiB       firefox
291.8 MiB +   2.5 MiB = 294.3 MiB       gnome-shell
272.2 MiB +  43.9 MiB = 316.1 MiB       chrome (12)
913.9 MiB +   3.2 MiB = 917.1 MiB       thunderbird
---------------------------------
                          1.9 GiB
=================================

The [-p PID,...] option allows filtering the results.
For example to restrict output to the current $USER you could:

sudo ps_mem -p $(pgrep -d, -u $USER)

or to summarize the total RAM usage per user you could:

for i in $(ps -e -o user=, sort, uniq); do
  printf '%-20s%10s\n' $i $(sudo ps_mem --total -p $(pgrep -d, -u $i))
done

主要指標

概覽
名稱與所有者pixelb/ps_mem
主編程語言Python
編程語言Python (語言數: 2)
平台
許可證GNU Lesser General Public License v2.1
所有者活动
創建於2013-09-06 16:15:41
推送於2022-10-19 01:37:40
最后一次提交2022-05-28 11:21:16
發布數5
最新版本名稱v3.14 (發布於 )
第一版名稱v3.5 (發布於 )
用户参与
星數1.6k
關注者數75
派生數288
提交數76
已啟用問題?
問題數52
打開的問題數17
拉請求數7
打開的拉請求數3
關閉的拉請求數20
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?