--How to view memory consumption at the OS level for a single process
Aix:
$ svmon-pt10 | Perl-e ' while (<>) {print if ($.==2| | $&&&! $s + +); $.=0 if (/^-+$/)} '-----use this to see the largest memory-consuming 10 processes------------------------------------------ -------------------------------------Pid Command Inuse Pin pgsp Virtual 64-bit mthrd 16MB 5 111942 Svmon 22446 8768 0 22370 Y n n 4391128 ksh 18298 8724
0 18232 n n n 5308430 perl5.8.8 18262 8724 0 18245 n n \ n
AIX: (also available under Linux) $ ps gv PID TTY STAT time pgin SIZE RSS LIM tsiz TRS%cpu%mem COMMAND 0-A 0:51 7 384 384 xx 0 0 0.0 0.0 swapper 1-a 5:26 105 752 7
32768 0.0 0.0/etc/in 131076-a 5478:05 0 448 448 xx 0 0 25.8 0.0 wait 196614-a 0:00 0 448 448 xx 0 0 0.0 0.0 sched 262152 -A 0:00 0 0.0 xx 0 0 0.0 lrud 327690-a 0:00 0 448 448 XX 0 0 0.0 0.0 vmptacrt 393228-a 0:00 0 xx 0 0 0.0 0.0 psmd 458766 -A 0:00 0 896 896 xx 0 0 0.0 0.0 vmmd 524304-a 0:00 0 448 448 xx 0
0 0.0 0.0 memgrdd 589842-a 0:00 0 448 448 xx 0 0 0.0 0.0 lsareapr Under AIX, see the top 10 memory-consuming processes $ ps Gv|sort-rn +6|head-10--------------This is also very intuitive 4128976-a 1:06 2743 42476 42548 32768 0.0 4.0/usr/ja 2687164-a 0:09 31 9000 9084 32768 60 84 0.0 1.0 /USR/SB 2883710-a 0:00 Notoginseng 5696 5904 32768 518 0.0 0.0/USR/SB 3014794-a 0:01 5672 5892 32768 394 0.0 0.0/usr/sb 3145838-a 0:00 32 5540 5668 32768 164 128 0.0 0 .0/USR/SB 3080322 -A 0:00 5472 5528 32768 0.0-0.0/USR/SB 4194350-a 0:05 412 4708 5248 XX 555 540 0.0 0.0/USR/SB 3407976-a 0:06 144 4180 5244 32768 1213 1064 0.0 0.0 sendmai 3866866 -A 0:00 129 3792 4400 32768 524 608 0.0 0.0/usr/sb 2424972-a 0:00 76 4204 4384 32768 151 180 0.0 0.0/USR/SB $ AIX, Linux---------------recommend using this $ PS aux | Head-1; PS aux | Sort-rn +3 | head-10 USER PID%cpu%mem SZ RSS TTY STAT stime time COMMAND pconsole 4128976 0.0 4.0 42540 4254 8-a Apr 1:06/usr/java5/bin/root 2687164 0.0 1.0 9056 9084-a APR 0:09/usr/sbin/c Ron Root 5636150 0.0 0.0 3928 3940-a 22:37:25 0:00 telnetd-a root 5046428 0.0 0.0 1628 1652 -A APR 0:00/usr/sbin/rsct/root 4849856 0.0 0.0 2624 2140-a APR one 0:00/usR/sbin/rsct/root 4784276 0.0 0.0 344 348-a Apr 0:00/usr/sbin/rpc.l root 4718738 0.0 0. 0 1216 1216-a Apr 0:17 rpc.lockd root 4653208 0.0 0.0 108 112-a APR 0:00/USR/SB In/uprin root 4587674 0.0 0.0 332 340-a Apr 0:00/usr/sbin/write root 4456616 0.0 0.0 40 3904-a APR 0:25/usr/bin/topasr $ svmon-up-t 50|grep-p pid|grep ' ^.*[0-9] ' 5112000 Svmon 22452 8768 0 22370 Y n n 4391128 ksh 18298 8724 0 18232 N-N-n 5308462 grep 18163 8724 0 18154 N-N 5767348 GRE
P 18163 8724 0 18154 n n N $ svmon-p-O summary=basic,unit=mb unit:mb -------------------------------------------------------------------------------Pid Command Inuse P
In Pgsp Virtual5112002 Svmon 87.7 34.2 0 87.4 4391128 ksh 71.5 34.1 0 71.2 $ $ Svmon-u ' ps-ef|cut-c1-8|sort-u '-o segment=off-o unit=mb unit:mb ==================================== =========================================== User Inuse Pin pgsp Virtual ORAC Le 121.07 34.3 0 120.49 segment=off * * * user does No T exist * * * * Pconsole-o user does not exist * * * daemon User does not exist * * * Root * * * user does not exist * * * UID User does not exist * * *
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/unix/
Author: csdn Blog Lixora