How to view memory consumption of a single process at the OS level in AIX/LINUX

Source: Internet
Author: User

Zookeeper


-- How to view memory consumption of a single process at the OS level

AIX:

$ Svmon-Pt10 | perl-e 'while (<>) {print if ($. = 2 | $ &&&! $ S ++); $. = 0 if (/^-+ $/)} '---- This shows the top 10 processes that occupy the maximum memory.
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16 MB
5111942 svmon 22446 8768 0 22370 Y N
4391128 ksh 18298 8724 0 18232 N
5308430 perl5.8.8 18262 8724 0 18245 N


AIX: (available in linux)
$ Ps gv
Pid tty stat time pgin size rss lim tsiz trs % CPU % MEM COMMAND
0-A 7 384 384 xx 0 0.0 0.0 swapper
1-A 105 752 796 32768 31 44 0.0 0.0/etc/in
131076-A 5478: 05 0 448 448 xx 0 25.8 0.0 wait
196614-A 0 448 448 xx 0 0.0 0.0 sched
262152-A 0 512 512 xx 0 0.0 0.0 lrud
327690-A 0 448 448 xx 0 0.0 0.0 vmptacrt
393228-A 0 512 512 xx 0 0.0 0.0 psmd
458766-A 0 896 896 xx 0 0.0 0.0 vmmd
524304-A 0 448 448 xx 0 0.0 0.0 memgrdd
589842-A 0 448 448 xx 0 0.0 0.0 lsareapr


View the top 10 processes with the largest memory consumption in aix
$ Ps gv | sort-rn + 6 | head-10 -------------- this is also very intuitive
4128976-A 06 2743 42476 42548 68 72 32768 0.0/usr/ja
2687164-A 31 9000 9084 32768 60 84 0.0 1.0/usr/sb
2883710-A 37 5696 5904 32768 518 208 0.0/usr/sb
3014794-A 01 55 5672 5892 32768 394 220 0.0/usr/sb
3145838-A 32 5540 5668 32768 164 128 0.0/usr/sb
3080322-A 24 5472 5528 32768 43 56 0.0 0.0/usr/sb
4194350-A 412 4708 5248 xx 555 540 0.0 0.0/usr/sb
3407976-A 144 4180 5244 32768 1213 1064 0.0 0.0 sendmai
3866866-A 129 3792 4400 32768 524 608 0.0 0.0/usr/sb
2424972-A 76 4204 4384 32768 151 180 0.0/usr/sb


$



Aix, linux --------------- this is recommended

$ 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-A Apr 11/usr/java5/bin/
Root 2687164 0.0 1.0 9056-A Apr 11/usr/sbin/cron
Root 5636150 0.0 0.0 3928-A 22:37:25 telnetd-
Root 5046428 0.0 0.0 1628-A Apr 11/usr/sbin/rsct/
Root 4849856 0.0 0.0 2624-A Apr 11/usr/sbin/rsct/
Root 4784276 0.0 0.0 344-A Apr 11/usr/sbin/rpc. l
Root 4718738 0.0 0.0 1216 1216-A Apr 11 rpc. lockd
Root 4653208 0.0 0.0 108-A Apr 11/usr/sbin/uprin
Root 4587674 0.0 0.0 332-A Apr 11/usr/sbin/write
Root 4456616 0.0 0.0 4064-A Apr 11/usr/bin/topasr


$ Svmon-uP-t 50 | grep-p Pid | grep '^. * [0-9]'
5112000 svmon 22452 8768 0 22370 Y N
4391128 ksh 18298 8724 0 18232 N
5308462 grep 18163 8724 0 18154 N
5767348 grep 18163 8724 0 18154 N
$ Svmon-P-O summary = basic, unit = MB
Unit: MB

-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual
5112002 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
Oracle 121.07 34.3 0 120.49
Segment = off *** user does not exist ***
Pconsole-O *** user does not exist ***
Daemon *** user does not exist ***
Root *** user does not exist ***
UID *** user does not exist ***

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.