zoukankan      html  css  js  c++  java
  • AIX详细查看用户/进程使用内存

    本文来自:https://blog.csdn.net/mydriverc2/article/details/41956063

    问题描述:通过topas发现%comp内存已使用98%  

    问题分析:  

    1,从大到小排列10个内存使用率进程

    ps aux |  head -1 ;  ps aux |  sort -rn +3 |  head -10

    如详细查看进程: ps -ealf |  head -1 ;  ps -ealf |  sort -rn +9 |  head    -10

    # ps aux | head -1 ; ps aux | sort -rn +3 | head -10

    USER         PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND

    root     6553834  0.1  3.0 115064 115080      - A      Feb 20 86:08 /var/opt/tivoli

    root     5701730  0.0  1.0 17480 21956      - A      Mar 05  1:17 /opt/BESClient/

    pconsole 4456680  0.0  1.0 42456 42464      - A      Feb 20  3:11 /usr/java5/bin/

    root     6750376  0.0  0.0  796  824  pts/0 A    11:29:26  0:00 ps aux 

    root     6488234  0.0  0.0  260  268      - A      Mar 13  0:02 auditbin 

    root     6357208  0.0  0.0  236  248  pts/0 A    11:29:26  0:00 sort -rn +3 

    root     5963962  0.0  0.0 1768 1804      - A      Feb 20  0:00 /usr/sbin/rsct/

    root     5832798  0.0  0.0  836  856      - A    11:29:12  0:00 telnetd -a 

    root     5570748  0.0  0.0 2128 2096      - A      Feb 20  0:00 /usr/sbin/rsct/

    root     5308652  0.0  0.0 7328 7436      - A      Feb 20  1:01 /usr/sbin/rsct/

    2,根据某个命令或进程名,查看内存使用率

    # ps aux | head -1 ; ps aux | grep topas

    如详细查看:

    USER         PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND

    root     2359426  0.0  0.0 1440 1272      - A      Feb 20  1:08 /usr/bin/topasr

    root     6160578  0.0  0.0  252  264  pts/0 A    11:36:45  0:00 grep topas 

    但有的时候ps aux并不能非常详细地表现出进程的完整使用率

    3,通过root用户svmon用户可以分析出内存使用量

    # svmon -G

                   size       inuse        free         pin     virtual   mmode

    memory      1048576     1037487       11089      229668      378796     Ded

    pg space    2097152        2360

                   work        pers        clnt       other

    pin          196952           0           0       32716

    in use       378796           0      658691

    PageSize   PoolSize       inuse        pgsp         pin     virtual

    s    4 KB         -      793327        2360       49188      134636

    m   64 KB         -       15260           0       11280       15260

    inuse:是物理内存使用量,这里是以4K为单位,所以 1037487*4096=4249546752(424M)

    virtual:是虚拟内存使用量,这里是以4K为单位,所以 378796*4096=1551548416(155M)

    4,显示使用物理内存最多的3个进程:

    # svmon -uP -t 3|grep -p Pid|grep '^.*[0-9] '

     6553834 java             51279     8917        0    50938      N     Y     N

     4456680 java             34626     8874        0    34608      N     Y     N

     5701730 BESClient        29564     8882        0    25689      Y     Y     N

    输出的格式顺序为 Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 

    可以计算出X程序所使用的实存为51279×4096=210038784,约为210MB

  • 相关阅读:
    (二)常问升级小点
    (一)常问基础小点
    Linux之expr命令详解
    Mac--Visual Studio Code 常用快捷键
    git撤销commit操作回到add状态
    ExampleMatcher ,在查询非int 或boolean 字段时要使用 withIgnorePaths() 忽略 int 和boolean 字段,要不然查询不到值
    navicat 用url 连接mongo
    javase 打印杨辉三角
    关系型数据库遵循ACID规则
    Redis介绍
  • 原文地址:https://www.cnblogs.com/lhdz_bj/p/10767702.html
Copyright © 2011-2022 走看看