成长值: 15613
2444
2544
7万
管理员
ps_mem 是一个可以帮助我们精确获取 Linux 中各个程序核心内存使用情况的简单 python 脚本。这个工具和其它的区别在于其精确显示核心内存使用情况。 -- 2daygeek
本文导航 -通过包管理器安装 ps_mem …… 21% -通过 pip 安装 ps_mem …… 33% -直接运行 ps_mem.py 脚本 …… 50% -ps_mem 使用方法 …… 55%
编译自: http://www.2daygeek.com/ps_mem-report-core-memory-usage-accurately-in-linux/ 作者: 2daygeek 译者: xllc
$ sudo yum install ps_mem
$ sudo dnf install ps_mem
$ sudo pacman -S ps_mem
$ sudo apt-get install python-pip
$ sudo yum install python-pip
$ sudo dnf install python-pip
$ sudo zypper install python-pip
$ sudo pacman -S python-pip
$ sudo pip install ps_mem
$ git clone https://github.com/pixelb/ps_mem.git && cd ps_mem $ sudo python ps_mem.py
$ sudo ps_mem Private + Shared = RAM used Program 1.6 MiB + 438.5 KiB = 2.1 MiB packagekitd 1.7 MiB + 498.0 KiB = 2.1 MiB indicator-application-service 912.0 KiB + 1.3 MiB = 2.2 MiB window-stack-bridge 2.0 MiB + 350.5 KiB = 2.3 MiB gnome-keyring-daemon 1.8 MiB + 575.0 KiB = 2.3 MiB whoopsie 2.4 MiB + 304.5 KiB = 2.7 MiB systemd-journald 2.7 MiB + 157.5 KiB = 2.8 MiB ibus-engine-simple 2.7 MiB + 182.0 KiB = 2.9 MiB ibus-dconf 2.7 MiB + 332.5 KiB = 3.0 MiB NetworkManager 3.1 MiB + 169.5 KiB = 3.2 MiB polkitd 1.9 MiB + 1.7 MiB = 3.6 MiB systemd (2) 3.4 MiB + 172.5 KiB = 3.6 MiB deja-dup-monitor 2.9 MiB + 685.0 KiB = 3.6 MiB zeitgeist-datahub 2.9 MiB + 848.0 KiB = 3.7 MiB python2.7 . . . . . . 222.1 MiB + 9.4 MiB = 231.5 MiB compiz 286.2 MiB + 11.8 MiB = 298.0 MiB firefox --------------------------------- 1.3 GiB =================================
$ sudo ps_mem -s Private + Shared = RAM used Program 3.2 MiB + 951.0 KiB = 4.1 MiB /usr/lib/evolution/evolution-addressbook-factory 3.7 MiB + 826.5 KiB = 4.5 MiB /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 3.7 MiB + 853.0 KiB = 4.6 MiB /usr/lib/unity-settings-daemon/unity-fallback-mount-helper . . . . . . 131.9 MiB + 168.0 KiB = 132.1 MiB /usr/sbin/mysqld 222.1 MiB + 9.4 MiB = 231.5 MiB /usr/bin/compiz 286.2 MiB + 11.8 MiB = 298.1 MiB /usr/lib/firefox/firefox --------------------------------- 1.3 GiB =================================
$ sudo ps_mem -p 2886,4386 Private + Shared = RAM used Program 13.5 MiB + 2.9 MiB = 16.4 MiB gnome-terminal-server 286.2 MiB + 11.8 MiB = 298.0 MiB firefox --------------------------------- 314.4 MiB =================================
$ sudo ps_mem w 2
$ sudo ps_mem -t 1329884160
您需要 登录 才可以下载或查看,没有帐号?立即注册
使用道具 举报
本版积分规则 发表回复
Archiver|手机版|小黑屋|51学通信技术论坛
GMT+8, 2025-1-31 18:02 , Processed in 0.063595 second(s), 33 queries .
Powered by Discuz! X3
© 2001-2013 Comsenz Inc.