ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [20131013]ps_mem.txt

[20131013]ps_mem.txt

原创 Linux操作系统 作者:lfree 时间:2013-10-12 15:43:41 0 删除 编辑
[20131013]ps_mem.txt

链接:
https://github.com/pixelb/ps_mem

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.

Usage:

ps_mem [-h|--help] [-s|--split-args] [-p PID] [-w N]

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 -u $USER | paste -d, -s)


下载地址:
https://github.com/pixelb/ps_mem/blob/master/ps_mem.py

自己测试一下生产系统的服务器:
# ./ps_mem.py
 Private  +   Shared  =  RAM used       Program

  4.0 KiB +   9.5 KiB =  13.5 KiB       acpid
  4.0 KiB +  10.5 KiB =  14.5 KiB       portreserve
  4.0 KiB +  25.0 KiB =  29.0 KiB       abrt-dump-oops
  4.0 KiB +  28.0 KiB =  32.0 KiB       xinetd
 12.0 KiB +  29.5 KiB =  41.5 KiB       mingetty (3)
 32.0 KiB +  26.5 KiB =  58.5 KiB       atd
 52.0 KiB +   9.0 KiB =  61.0 KiB       cachefilesd
 24.0 KiB +  60.5 KiB =  84.5 KiB       stap-serverd
 68.0 KiB +  36.0 KiB = 104.0 KiB       rpc.statd
 96.0 KiB +  31.5 KiB = 127.5 KiB       rpc.idmapd
116.0 KiB +  27.5 KiB = 143.5 KiB       crond
156.0 KiB +  17.0 KiB = 173.0 KiB       lldpad
156.0 KiB +  37.5 KiB = 193.5 KiB       rpcbind
180.0 KiB +  25.5 KiB = 205.5 KiB       irqbalance
204.0 KiB +  55.0 KiB = 259.0 KiB       automount
248.0 KiB +  31.0 KiB = 279.0 KiB       init
288.0 KiB +  75.0 KiB = 363.0 KiB       udevd (3)
420.0 KiB +  41.0 KiB = 461.0 KiB       rsyslogd
496.0 KiB + 176.0 KiB = 672.0 KiB       ksmtuned
  1.5 MiB + 118.5 KiB =   1.6 MiB       snmpd
  2.5 MiB +  42.0 KiB =   2.5 MiB       tnslsnr
  2.3 MiB + 571.5 KiB =   2.9 MiB       sshd (2)
  4.2 MiB + 194.0 KiB =   4.3 MiB       bash
  9.3 GiB + 122.7 MiB =   9.4 GiB       oracle (1915)
---------------------------------
                          9.4 GiB
=================================

自己对这些不是很了解,不知道是否正确!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-774247/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2455
  • 访问量
    6257657