- 论坛徽章:
- 0
|
原帖由 saintdragon 于 2007-11-9 16:46 发表 ![]()
不知道sar是否可以
用sar不行。sco下的ps -o也能显示进程的内存使用情况。具体的用法man ps。
-o format
List process data in the specified format. Multiple -o options can be specified on the command line.
format is a comma or whitespace separated list of field names; the list must be placed in quotation marks if whitespace separation is used. ps displays the fields in the order specified on the command line.
You can override the default header for a field by appending a ``='' and the new header text to the field name:
-o field=header
If the header text contains whitespace, enclose the entire field=header string in quotation marks and specify it using a separate -o option:
-o "field=header"
You can prevent a header from being displayed for an individual field by not specifying it after the ``=''. If all field names have a single ``='' appended but no header text, no header line is displayed at all.
ps changes the field width from its default value to match the width of the specified header text.
Allowed field names follow (default headers are shown in parentheses):
pid
Process ID as a decimal value. (PID)
ppid
Parent process ID as a decimal value. (PPID)
pgid
Process group ID as a decimal value. (PGID)
uid
Real user ID of the process as a decimal value. (UID)
user
The effective user ID of the process. (USER)
ruser
Real user ID of the process. (RUSER)
comm
Command name; may contain spaces. (COMMAND)
args
Command name with its arguments; may contain spaces and may be truncated to fit the width of the field. (COMMAND)
group
Effective group ID of the process. (GROUP)
rgroup
Real group ID of the process. (RGROUP)
nice
nice value of the process; see nice(C) and renice(C). (NI)
pri
Priority value of the process. (PRI)
pcpu
Percentage of CPU time recently used by the process. (%CPU)
sess
Process session leader ID as a decimal value. (SESSION)
size
Size of the swappable image of the process (data and stack) in kilobytes. (SZ)
vsz
Virtual memory size of the process in kilobytes. (VSZ)
addr
Virtual address of the process' entry in the process table. (ADDR)
class
Scheduler class of the process. (CLASS)
time
Cumulative CPU time used by the process. (TIME)
stime
Time when the process started. (STIME)
etime
Time elapsed since the process started. (ELAPSED)
tty
Name of the controlling terminal for the process. (TTY)
wchan
Address of an event for which a process is sleeping. (WCHAN)
For fields user, ruser, group, and rgroup, ps displays the user or group name if it can be obtained and it will fit in the field. Otherwise it displays the decimal value of the ID. |
|