svmon -P -t 3 -i 5,该命令每5秒种输出一次最耗内存的前3个进程
(输出省略了一部分)
说明(为了表述明确,分别贴出了中英文对照)
Process Report
The process report is printed when the -P flag is specified. The column headings in a process report are:
Pid
Indicates the process ID.
Command
Indicates the command the process is running.
Inuse
Indicates the total number of pages in real memory in segments that are used by the process.
Pin
Indicates the total number of pages pinned in segments that are used by the process.
Pgsp
Indicates the total number of pages reserved or used on paging space by segments that are used by the process.
Virtual
Indicates the total number of pages allocated in the process virtual space.
64-bit
Indicates if the process is a 64 bit process (Y) or a 32 bit process (N).
Mthrd
Indicates if the process is multi-threaded (Y) or not (N).
16MB
Indicates the 16MB page status of the process. "M" stands for mandatory, "Y" means that the process uses or has used
16MB page segments and "N" means that the process does not use 16MB pages.
If the process uses pages of a size other than the base 4KB page size, these statistics are followed by the
distribution between the different page sizes.
After process information is displayed, svmon displays information about all the segments the process uses. Information
about segment are described in the paragraph Segment Report
If the -q flag is specified, only processes using segments of the requested size are reported. Note that all of the
segments for these processes are reported. If a list of processes is specified, an error is reported for each process not
using segments of the requested size.
只有指定了 -P 标志,才打印进程报告。进程报告中的列标题是:
如果定义了大页池,那么在不同页面大小间的分布跟随这些信息。
显示进程信息之后,svmon 显示关于进程使用的所有段的信息。段落段报告描述了段的信息。
如果指定了 -q 标志,那么只报告标记为大页面进程(LPage)的进程。注意要报告这些进程中所有的段。如果指定了一列进程,那么就会向未标记为大页面的每个进程报告错误。
只有指定了 -S 标志,才打印段报告。段报告中的列标题是:
原文转自:http://www.linuxso.com/linuxrumen/20370.html
(1)显示10个消耗cpu最多的进程
# ps aux |head -1 ;ps aux |sort -rn +2 |head -10
(2)显示10个消耗内存最多的进程
#ps vx |head -1 ;ps vx |grep -v PID |sort -rn +6 |head -10
(3)显示10个换页最多的进程
#ps vx |head -1 ;ps vx |grep -v PID |sort -rn +4 |head -10
(4)显示10个消耗存储空间最多的进程
#ps aux |head -1 ;ps aux |sort -rn +3 |head -10
如何监控进程的内存使用情况(AIX)
AIX监控进程内存使用的工具比较多,个人觉得比较方便的有nmon,svmon,其中svmon是AIX自带的工具,
需要root权限执行,可以监控进程详细内存使用信息,如:
svmon -P pid(要监控的进程PID) -i 1 (每秒刷新一次) |grep pid
AIX下进程内存分析
AIX下可以使用ps v工具或者svmon工具来分析进程内存。ps v命令是ps命令的一个工
具,要注意的是v之前不要加”-“。ps v工具在任何AIX操作系统下都可以使用。比
如:
# ps -lfp 13288
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
240001 A oracle 13288 1 0 60 20 1ba2f 34032 Nov 03 - 0:06
ora_pmon_DEV
# ps v 13288
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
13288 - A 0:08 225 5616 13904 32768 28420 13512 0.0 1.0
ora_pmon_DEV
从ps命令看到sz是34M。而用ps v命令可以看到rss是13904,TRS是13512。进程使用的
内存是RSS-TRS=392K(ps v看到的内存单位是K)。
用svmon可以看到更多的信息,其结果和ps v是一致的。比如:
#svmon -P 23288
----------------------------------------------------------------------------
---
Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd
23288 ora_pmon_V8 29598 1451 182 16560 N N
Vsid Esid Type Description Inuse Pin Pgsp Virtual Addr
Range
1781 3 work shmat/mmap 11824 0 0 11824
0..24700
1761 1 pers code,large file /dev 9681 0 - -
0..9680
0 0 work kernel seg 3982 1450 182 3390
0..21804 :
65474..65535
18018 d work shared library text 2852 0 0 158
0..65535
4764 2 work process private 1127 1 0 1127
0..1182 :
65307..65535
f74f f work shared library data 81 0 0 61
0..1291
1e59e - pers large file /dev/lv00 33 0 - - 0..32
e58e - pers large file /dev/lv00 16 0 - - 0..82
b74b - pers large file /dev/lv00 1 0 - - 0..0
3703 - pers large file /dev/lv00 1 0 - - 0..0
#ps v 23288
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM
COMMAND
23288 - A 0:00 0 4752 43556 32768 27289 38724 0.0 5.0
ora_pmon_V8
要注意的是,svmon显示的内存都是以Page为单位的,AIX下,每个页为4K。
通过work process private的virtual大小和work shared library data的virtual大小
的和ps v的SIZE是完全一致的:
4752K=(1127+61)×4K
而RSS的内容相当于linux项目的private working-storage segments加上pers code和
shared library data。
43556K=(1127 + 9681 + 81)*4K
TRS就是INUSE项目的pers code:
38724K=9681*4K
ps:原文转自http://www.cnblogs.com/wolly/archive/2010/04/09/1708194.html