]>
Commit | Line | Data |
---|---|---|
1 | .\" Copyright (c) 1999, Apple Computer, Inc. All rights reserved. | |
2 | .\" | |
3 | .Dd September 30, 1999 | |
4 | .Dt TOP 1 | |
5 | .Os "Mac OS X" | |
6 | .Sh NAME | |
7 | .Nm top | |
8 | .Nd show system usage statistics | |
9 | .Sh SYNOPSIS | |
10 | .Nm top | |
11 | .Op Fl u | |
12 | .Op Fl w | |
13 | .Op Fl k | |
14 | .Op Fl s Ar interval | |
15 | .Op Fl e | Fl d | Fl a | |
16 | .Op Fl l Ar samples | |
17 | .Op Ar number | |
18 | .Sh DESCRIPTION | |
19 | .Nm top | |
20 | displays an ongoing sample of system usage statistics. It operates | |
21 | in various modes, but by default shows cpu utilization and | |
22 | memory usage for each process in the system. | |
23 | .Pp | |
24 | The options are as follows: | |
25 | .Bl -tag -width Ds | |
26 | .It Fl u | |
27 | When the | |
28 | .Fl u | |
29 | option is specified, processes are first sorted by cpu usage | |
30 | and then displayed starting with the highest consumers. | |
31 | .It Fl w | |
32 | Specifying the | |
33 | .Fl w | |
34 | option generates additional columns in the output producing | |
35 | a much wider display of data. The additional columns include | |
36 | VPRVT, along with the delta information for #PRTS, | |
37 | RPRVT, RSHRD, RSIZE and VSIZE (see descriptions following). | |
38 | .It Fl k | |
39 | The | |
40 | .Fl k | |
41 | option causes | |
42 | .Nm top | |
43 | to traverse and report the memory object map for pid 0 | |
44 | (the kernel task). It is optional because it is fairly | |
45 | expensive to traverse the object maps and the kernel | |
46 | task may have a huge number of entries. | |
47 | .It Fl s | |
48 | By default, | |
49 | .Nm top | |
50 | updates its output at one second intervals. This sampling | |
51 | interval may be changed by specifying the | |
52 | .Fl s | |
53 | option. Enter the | |
54 | .Ar interval | |
55 | in seconds. | |
56 | .It Fl e | |
57 | Using the | |
58 | .Fl e | |
59 | option switches from the default output to an event counting | |
60 | mode where the counts reported are absolute counters. The | |
61 | .Fl w | |
62 | and | |
63 | .Fl k | |
64 | options are ignored when running in event counting mode. | |
65 | .It Fl d | |
66 | Using the | |
67 | .Fl d | |
68 | option switches from the default output to an event counting | |
69 | mode where the counts are reported as deltas relative to | |
70 | the previous sample. | |
71 | The | |
72 | .Fl w | |
73 | and | |
74 | .Fl k | |
75 | options are ignored when running in event counting, delta mode. | |
76 | .It Fl a | |
77 | Using the | |
78 | .Fl a | |
79 | option switches from the default output to an event counting | |
80 | mode where the counts are reported as cumulative counters relative to | |
81 | when top was launched. | |
82 | The | |
83 | .Fl w | |
84 | and | |
85 | .Fl k | |
86 | options are ignored when running in event counting, accumulate mode. | |
87 | .It Fl l | |
88 | Using the | |
89 | .Fl l | |
90 | option switches from the default screen mode to a logging mode suitable for | |
91 | saving the output to a file. You may specify the number of samples to be | |
92 | output before top exits, the default is 1 sample. | |
93 | .It number | |
94 | If you wish to limit the number of processes displayed by | |
95 | .Nm top, | |
96 | specify the desired | |
97 | .Ar number | |
98 | of output lines in this last argument. | |
99 | .El | |
100 | .Pp | |
101 | The columns displayed in the default data mode are as follows: | |
102 | .Bl -tag -width VSIZE(deltadelta) -compact | |
103 | .Pp | |
104 | .It PID | |
105 | the Unix process id. | |
106 | .It COMMAND | |
107 | the Unix command name. | |
108 | .It %CPU | |
109 | the percentage of cpu consumed (kernel and user). | |
110 | .It TIME | |
111 | the absolute cpu consumption (min:secs.hundreths). | |
112 | .It #TH | |
113 | the number of threads. | |
114 | .It #PRTS(delta) | |
115 | the number of mach ports. | |
116 | .It #MREG | |
117 | the number of memory regions. | |
118 | .It VPRVT(-w only) | |
119 | the private address space currently allocated. | |
120 | .It RPRVT(delta) | |
121 | the resident private memory. | |
122 | .It RSHRD(delta) | |
123 | the resident shared memory (as represented by the | |
124 | resident page count of each shared memory object). | |
125 | .It RSIZE(delta) | |
126 | the total resident memory (real pages that this | |
127 | process currently has associated with it. Some | |
128 | may be shared by other processes). | |
129 | .It VSIZE(delta) | |
130 | the total address space currently allocated (including shared). | |
131 | .El | |
132 | .Pp | |
133 | The delta columns are enabled by the | |
134 | .Fl w | |
135 | option. The deltas for #PRTS and VSIZE are relative | |
136 | to the numbers observed when | |
137 | .Nm top | |
138 | was launched. The deltas for RPRVT, RSHRD and RSIZE are relative to | |
139 | the previous sample. If the | |
140 | .Fl w | |
141 | option was not specified, | |
142 | .Nm top | |
143 | will append either a '+' or a '-' to the RPRVT, RSHRD, RSIZE or VSIZE | |
144 | columns indicating either a gain or a loss relative to the previous sample. | |
145 | .Pp | |
146 | The columns displayed in the event counting modes (ie: -e | -d | -a options) | |
147 | are as follows: | |
148 | .Bl -tag -width MACHSYSCALL -compact | |
149 | .Pp | |
150 | .It PID | |
151 | the Unix process id. | |
152 | .It COMMAND | |
153 | the Unix command name. | |
154 | .It %CPU | |
155 | the percentage of cpu consumed (kernel and user). | |
156 | .It TIME | |
157 | the absolute cpu consumption (min:secs.hundreths). | |
158 | .It FAULTS | |
159 | the number of page faults. | |
160 | .It PAGEINS | |
161 | the number of requests for pages from a pager. | |
162 | .It COW_FAULTS | |
163 | the number of faults that caused a page to be copied. | |
164 | .It MSGS_SENT | |
165 | the number of mach messages sent by the process. | |
166 | .It MSGS_RCVD | |
167 | the number of mach messages received by the process. | |
168 | .It BSDSYSCALL | |
169 | the number of BSD system calls made by the process. | |
170 | .It MACHSYSCALL | |
171 | the number of MACH system calls made by the process. | |
172 | .It CSWITCH | |
173 | the number of context switches to this process. | |
174 | .El | |
175 | .Pp | |
176 | The | |
177 | .Nm top | |
178 | command also displays some global state in the first few lines of output, | |
179 | including load averages, cpu utilization and idleness, process and thread counts and memory breakdowns | |
180 | for shared libraries and processes. | |
181 | The | |
182 | .Nm top | |
183 | command is SIGWINCH savvy, so adjusting your window geometry may change | |
184 | the number of processes and number of columns displayed. Typing a 'q' will cause top to exit | |
185 | immediately. Typing any other character will cause top to immediately update it's display. | |
186 | .Sh SAMPLE USAGE | |
187 | .Pp | |
188 | top -u -s5 20 | |
189 | .Pp | |
190 | .Nm top | |
191 | will sort the processes according to cpu usage, update the output at 5 | |
192 | second intervals, and limit the display to the top 20 processes. | |
193 | .Sh SEE ALSO | |
194 | .Xr vm_stat 1 |