7 .Nd display and update information about the top cpu processes
10 .Op Fl abCHIijnPpqSTtuvxz
22 processes on the system and periodically updates this information.
23 If standard output is an intelligent terminal (see below) then
24 as many processes as will fit on the terminal screen are displayed
26 Otherwise, a good number of them are shown (around 20).
27 Raw cpu percentage is used to rank the processes.
30 is given, then the top
32 processes will be displayed instead of the default.
35 makes a distinction between terminals that support advanced capabilities
36 and those that do not.
37 This distinction affects the choice of defaults for certain options.
38 In the remainder of this document, an
41 supports cursor addressing, clear screen, and clear to end of line.
44 terminal is one that does not support such
48 is redirected to a file, it acts as if it were being run on a dumb
51 The options are as follows:
52 .Bl -tag -width indent
54 Display command names derived from the argv[] vector, rather than real
56 It it useful when you want to watch applications, that
57 puts their status information there.
58 If the real name differs from argv[0],
59 it will be displayed in parenthesis.
60 Non-printable characters in the command line are
61 encoded in C-style backslash sequences or
62 a three digit octal sequences.
67 In this mode, all input from the terminal is
69 Interrupt characters (such as ^C and ^\e) still have an effect.
70 This is the default on a dumb terminal, or when the output is not a terminal.
72 Toggle CPU display mode.
73 By default top displays the weighted CPU percentage in the WCPU column
74 (this is the same value that
79 flag is passed it toggles between
92 A display is considered to be one update of the
94 The default is 1 for dumb terminals.
98 no information is available about the percentage of time spent by the CPU in every state.
100 Display each thread for a multithreaded process individually.
101 By default a single summary line is displayed for each process.
103 Do not display idle processes.
104 By default, top displays both active and idle processes.
109 In this mode, any input is immediately
113 for an explanation of
114 which keys perform what functions.
115 After the command is processed, the
116 screen will immediately be updated, even if the command was not
118 This mode is the default when standard output is an
119 intelligent terminal.
121 Show only those processes owned by
123 This may be either the
130 to limit to host processes.
131 Using this option implies
138 Display statistics in the specified
154 Sort the process display area on the specified field.
156 is the name of the column as seen in the output, but in lower case:
174 Display per-cpu CPU usage statistics.
176 Show only the process
181 to -20 so that it will run faster.
182 This can be used when the system is
183 being very sluggish to improve the possibility of discovering the problem.
184 This option can only be used by root.
186 Show system processes in the display.
187 Normally, system processes such as the pager and the swapper are not shown.
188 This option makes them visible.
190 Set the delay between screen updates to
192 seconds, which may be fractional.
193 The default delay between updates is 1 second.
195 Toggle displaying thread ID (tid) instead of process id (pid).
201 Show only those processes owned by
203 This option currently only accepts usernames and will not understand
206 Do not map uid numbers to usernames.
209 will read as much of the file
211 as is necessary to map
212 all the user id numbers it encounters into login names.
213 This option disables all that, while possibly decreasing execution time.
214 The uid numbers are displayed instead of the names.
216 Write version number information to stderr then exit immediately.
218 Display approximate swap usage for each process.
220 Do not display the system idle process.
227 fields can be specified as
229 indicating that they can
230 stretch as far as possible.
231 This is accomplished by using any proper
232 prefix of the keywords
237 Boolean flags are toggles.
238 A second specification of any of these options will negate the first.
239 .Sh "INTERACTIVE MODE"
243 .Dq interactive mode ,
244 it reads commands from the
245 terminal and acts upon them accordingly.
246 In this mode, the terminal is
249 so that a character will be
250 processed as soon as it is typed.
251 Almost always, a key will be
254 is between displays; that is, while it is waiting for
257 If this is the case, the command will be
258 processed and the display will be updated immediately thereafter
259 (reflecting any changes that the command may have specified).
261 happens even if the command was incorrect.
262 If a key is pressed while
264 is in the middle of updating the display, it will finish the update and
265 then process the command.
266 Some commands require additional information,
267 and the user will be prompted accordingly.
268 While typing this information
269 in, the user's erase and kill keys (as set up by the command
271 are recognized, and a newline terminates the input.
273 These commands are currently recognized (^L refers to control-L):
274 .Bl -tag -width indent
278 Display a summary of the commands (help screen).
280 is included in this display.
285 Change the number of displays to show (prompt for new number).
286 Remember that the next display counts as one, so typing 'd1' will make
288 show one final display and then immediately exit.
290 Display only processes that contain the specified string in their
292 If displaying arguments is enabled, the arguments are searched
293 too. '+' shows all processes.
295 Toggle the display between 'cpu' and 'io' modes.
297 Change the number of processes to display (prompt for new number).
299 Change the number of seconds to delay between displays
300 (prompt for new number).
302 Toggle the display of system processes.
304 Toggle the display of process titles.
307 .Pq SIGKILL by default
308 to a list of processes.
309 This acts similarly to the command
314 of a list of processes.
315 This acts similarly to
318 Display only processes owned by a specific set of usernames (prompt for
320 If the username specified is simply
324 then processes belonging to all users will be displayed.
325 Usernames can be added
326 to and removed from the set by prepending them with
332 Change the order in which the display is sorted.
333 The sort key names include
341 Display a specific process (prompt for pid).
342 If the pid specified is simply
344 then show all processes.
346 Display a list of system errors (if any) generated by the last
349 Toggle the display of threads.
351 Toggle the display of idle processes.
353 Toggle the display of
357 Display only processes owned by a specific jail (prompt for jail).
358 If the jail specified is simply
360 then processes belonging
361 to all jails and the host will be displayed.
362 This will also enable the display of JID.
364 Toggle the display of per-CPU statistics.
366 Toggle display of TID and PID
368 Toggle the display of the
372 Toggle the display of swap usage.
374 Toggle the display of the system idle process.
377 The top few lines of the display show general information
378 about the state of the system, including
379 the last process id assigned to a process (on most systems),
380 the three load averages,
382 the number of existing processes,
383 the number of processes in each state
384 (sleeping, running, starting, zombies, and stopped),
385 and a percentage of time spent in each of the processor states
386 (user, nice, system, and idle).
387 It also includes information about physical and virtual memory allocation.
389 The remainder of the screen displays information about individual
391 This display is similar in spirit to
393 but it is not exactly the same.
394 PID is the process id,
395 JID, when displayed, is the
397 ID corresponding to the process,
398 USERNAME is the name of the process's owner (if
400 is specified, a UID column will be substituted for USERNAME),
401 PRI is the current priority of the process,
405 SIZE is the total size of the process (text, data, and stack),
406 RES is the current amount of resident memory,
407 SWAP is the approximate amount of swap, if enabled
408 (SIZE, RES and SWAP are given in kilobytes),
409 STATE is the current state (one of
420 or the event on which the process waits),
421 C is the processor number on which the process is executing
422 (visible only on SMP systems),
423 TIME is the number of system and user cpu seconds that the process has used,
424 WCPU, when displayed, is the weighted cpu percentage (this is the same
428 CPU is the raw percentage and is the field that is sorted to determine
429 the order of the processes, and
430 COMMAND is the name of the command that the process is currently running
431 (if the process is swapped out, this column is marked
434 If a process is in the
439 the state column will report the name of the event or lock on which the
441 Lock names are prefixed with an asterisk
445 .Sh DESCRIPTION OF MEMORY
447 Mem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free
448 ARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other
449 15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead
450 Swap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out
452 .Ss Physical Memory Stats
453 .Bl -tag -width "Uncompressed" -compact
455 number of bytes active
457 number of clean bytes inactive
459 number of dirty bytes queued for laundering
461 number of bytes wired down, including IO-level cached file data pages
463 number of bytes used for IO-level disk caching
468 These stats are only displayed when the ARC is in use.
470 .Bl -tag -width "Uncompressed" -compact
472 number of wired bytes used for the ZFS ARC
474 number of ARC bytes holding most recently used data
476 number of ARC bytes holding most frequently used data
478 number of ARC bytes holding in flight data
480 number of ARC bytes holding headers
482 miscellaneous ARC bytes
484 bytes of memory used by ARC caches
486 bytes of data stored in ARC caches before compression
488 compression ratio of data cached in the ARC
491 .Bl -tag -width "Uncompressed" -compact
493 total available swap usage
495 total free swap usage
499 bytes paged in from swap devices (last interval)
501 bytes paged out to swap devices (last interval)
504 .Bl -tag -width "Uncompressed"
506 Default set of arguments to
509 The locale to use when displaying the
520 .Xr humanize_number 3 ,
524 .An William LeFebvre, EECS Department, Northwestern University
526 The command name for swapped processes should be tracked down, but this
527 would make the program run slower.
531 things can change while
533 is collecting information for an update.
534 The picture it gives is only a close approximation to reality.