21.02.2013 Views

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.2.2 The ps command<br />

The ps command is a flexible tool for identifying the programs that are running on<br />

the system and the resources they are using. It displays statistics and status<br />

information about processes on the system, such as process or thread ID, I/O<br />

activity, CPU, and memory utilization.<br />

The ps command output and memory usage monitoring<br />

The ps command gives useful information on memory usage. The most useful<br />

output is presented in Table 10-2.<br />

Table 10-2 Memory-related ps output<br />

Column Value<br />

SIZE The virtual size of the data section of the process in 1-KB units<br />

RSS The real-memory size of the process in 1-KB units<br />

%MEM The percentage of real memory used by this process<br />

The SIZE column<br />

The v flag generates the SIZE column. This is the virtual size (in paging space) in<br />

kilobytes of the data section of the process (displayed as SZ by other flags). This<br />

number is equal to the number of working segment pages of the process that<br />

have been touched times four. If some working segment pages are currently<br />

paged out, this number is larger than the amount of real memory being used.<br />

SIZE includes pages in the private segment and the shared-library data segment<br />

of the process, as shown in the following example:<br />

# ps av |sort +5 -r |head -n 5<br />

PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND<br />

25298 pts/10 A 0:00 0 2924 12 32768 159 0 0.0 0.0 smitty<br />

13160 lft0 A 0:00 17 368 72 32768 40 60 0.0 0.0/usr/sbin<br />

27028 pts/11 A 0:00 90 292 416 32768 198 232 0.0 1.0 ksh<br />

24618 pts/17 A 0:04 318 292 408 32768 198 232 0.0 1.0 ksh<br />

The RSS column<br />

The v flag also produces the RSS column, as seen in the previous example. This<br />

is the real-memory (resident set) size, in kilobytes, of the process. This number is<br />

equal to the sum of the number of working segment and code segment pages in<br />

memory times four. Remember that code segment pages are shared among all<br />

of the currently running instances of the program. If 26 ksh processes are<br />

running, only one copy of any given page of the ksh executable program would<br />

be in memory, but the ps command would report that code segment size as part<br />

of the RSS of each instance of the ksh program.<br />

Chapter 10. Performance problem determination 251

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!