The ps (Process Status) command shows the current status of active processes. It is located /usr/bin, installed by default from the AIX base installation media, and is part of the bos.rte.commands fileset.
Usage: ps [-AMNaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
[-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist]
[-c classlist] [ -T pid] [ -L pidlist ]
Usage: ps [aceglnsuvwxU] [t tty] [processnumber]
Useful combinations of the ps command for memory statistics
- ps aux
- ps v
- ps -ealf
Using the ps command
The u and v flags report the following statistics
- %MEM, which is the percentage of real memory a process is using.
- RSS, the amount of real memory size of the process (in 1KB units).
The u flag also reports the SZ statistic, which represents the size of the core image of the process (in 1KB units).
The ps command can be used to determine what percentage of real memory a process is using. In Example 5-1 you can identify the processes using the highest percentages of real memory, by looking at the %MEM column, which is sorted in descending order.
Example using ps aux
ps aux | head -1 ; ps aux | sort -rn +3 | head
Example Using ps v
ps v 868488
The ps command can also be used to track how much virtual memory a process using. In Example below you can identify which processes are using the most amount of virtual memory, by looking at the SZ (size) column, which is listed in descending order.
Example using ps -ealf
r33n01:/ # ps -ealf | head -1 ; ps -ealf | sort -rn +9 | head
Post a Comment