6 .Nd display and update information about the top cpu processes
9 .Op Fl abCHIijnPpqSTtuvxz
21 processes on the system and periodically updates this information.
22 If standard output is an intelligent terminal (see below) then
23 as many processes as will fit on the terminal screen are displayed
25 Otherwise, a good number of them are shown (around 20).
26 Raw cpu percentage is used to rank the processes.
29 is given, then the top
31 processes will be displayed instead of the default.
34 makes a distinction between terminals that support advanced capabilities
35 and those that do not.
36 This distinction affects the choice of defaults for certain options.
37 In the remainder of this document, an
40 supports cursor addressing, clear screen, and clear to end of line.
43 terminal is one that does not support such
47 is redirected to a file, it acts as if it were being run on a dumb
50 The options are as follows:
51 .Bl -tag -width indent
53 Display command names derived from the argv[] vector, rather than real
55 It it useful when you want to watch applications, that
56 puts their status information there.
57 If the real name differs from argv[0],
58 it will be displayed in parenthesis.
59 Non-printable characters in the command line are
60 encoded in C-style backslash sequences or
61 a three digit octal sequences.
66 In this mode, all input from the terminal is
68 Interrupt characters (such as ^C and ^\e) still have an effect.
69 This is the default on a dumb terminal, or when the output is not a terminal.
71 Toggle CPU display mode.
72 By default top displays the weighted CPU percentage in the WCPU column
73 (this is the same value that
78 flag is passed it toggles between
91 A display is considered to be one update of the
93 The default is 1 for dumb terminals.
97 no information is available about the percentage of time spent by the CPU in every state.
99 Display each thread for a multithreaded process individually.
100 By default a single summary line is displayed for each process.
102 Do not display idle processes.
103 By default, top displays both active and idle processes.
108 In this mode, any input is immediately
112 for an explanation of
113 which keys perform what functions.
114 After the command is processed, the
115 screen will immediately be updated, even if the command was not
117 This mode is the default when standard output is an
118 intelligent terminal.
120 Show only those processes owned by
122 This may be either the
129 to limit to host processes.
130 Using this option implies
137 Display statistics in the specified
153 Sort the process display area on the specified field.
155 is the name of the column as seen in the output, but in lower case:
173 Display per-cpu CPU usage statistics.
175 Show only the process
180 to -20 so that it will run faster.
181 This can be used when the system is
182 being very sluggish to improve the possibility of discovering the problem.
183 This option can only be used by root.
185 Show system processes in the display.
186 Normally, system processes such as the pager and the swapper are not shown.
187 This option makes them visible.
189 Set the delay between screen updates to
191 seconds, which may be fractional.
192 The default delay between updates is 1 second.
194 Toggle displaying thread ID (tid) instead of process id (pid).
200 Show only those processes owned by
202 This option currently only accepts usernames and will not understand
205 Do not map uid numbers to usernames.
208 will read as much of the file
210 as is necessary to map
211 all the user id numbers it encounters into login names.
212 This option disables all that, while possibly decreasing execution time.
213 The uid numbers are displayed instead of the names.
215 Write version number information to stderr then exit immediately.
217 Display approximate swap usage for each process.
219 Do not display the system idle process.
226 fields can be specified as
228 indicating that they can
229 stretch as far as possible.
230 This is accomplished by using any proper
231 prefix of the keywords
236 Boolean flags are toggles.
237 A second specification of any of these options will negate the first.
238 .Sh "INTERACTIVE MODE"
242 .Dq interactive mode ,
243 it reads commands from the
244 terminal and acts upon them accordingly.
245 In this mode, the terminal is
248 so that a character will be
249 processed as soon as it is typed.
250 Almost always, a key will be
253 is between displays; that is, while it is waiting for
256 If this is the case, the command will be
257 processed and the display will be updated immediately thereafter
258 (reflecting any changes that the command may have specified).
260 happens even if the command was incorrect.
261 If a key is pressed while
263 is in the middle of updating the display, it will finish the update and
264 then process the command.
265 Some commands require additional information,
266 and the user will be prompted accordingly.
267 While typing this information
268 in, the user's erase and kill keys (as set up by the command
270 are recognized, and a newline terminates the input.
272 These commands are currently recognized (^L refers to control-L):
273 .Bl -tag -width indent
277 Display a summary of the commands (help screen).
279 is included in this display.
284 Change the number of displays to show (prompt for new number).
285 Remember that the next display counts as one, so typing 'd1' will make
287 show one final display and then immediately exit.
289 Display only processes that contain the specified string in their
291 If displaying arguments is enabled, the arguments are searched
292 too. '+' shows all processes.
294 Toggle the display between 'cpu' and 'io' modes.
296 Change the number of processes to display (prompt for new number).
298 Change the number of seconds to delay between displays
299 (prompt for new number).
301 Toggle the display of system processes.
303 Toggle the display of process titles.
306 .Pq SIGKILL by default
307 to a list of processes.
308 This acts similarly to the command
313 of a list of processes.
314 This acts similarly to
317 Display only processes owned by a specific set of usernames (prompt for
319 If the username specified is simply
323 then processes belonging to all users will be displayed.
324 Usernames can be added
325 to and removed from the set by prepending them with
331 Change the order in which the display is sorted.
332 The sort key names include
340 Display a specific process (prompt for pid).
341 If the pid specified is simply
343 then show all processes.
345 Display a list of system errors (if any) generated by the last
348 Toggle the display of threads.
350 Toggle the display of idle processes.
352 Toggle the display of
356 Display only processes owned by a specific jail (prompt for jail).
357 If the jail specified is simply
359 then processes belonging
360 to all jails and the host will be displayed.
361 This will also enable the display of JID.
363 Toggle the display of per-CPU statistics.
365 Toggle display of TID and PID
367 Toggle the display of the
371 Toggle the display of swap usage.
373 Toggle the display of the system idle process.
376 The top few lines of the display show general information
377 about the state of the system, including
378 the last process id assigned to a process (on most systems),
379 the three load averages,
381 the number of existing processes,
382 the number of processes in each state
383 (sleeping, running, starting, zombies, and stopped),
384 and a percentage of time spent in each of the processor states
385 (user, nice, system, and idle).
386 It also includes information about physical and virtual memory allocation.
388 The remainder of the screen displays information about individual
390 This display is similar in spirit to
392 but it is not exactly the same.
393 PID is the process id,
394 JID, when displayed, is the
396 ID corresponding to the process,
397 USERNAME is the name of the process's owner (if
399 is specified, a UID column will be substituted for USERNAME),
400 PRI is the current priority of the process,
404 SIZE is the total size of the process (text, data, and stack),
405 RES is the current amount of resident memory,
406 SWAP is the approximate amount of swap, if enabled
407 (SIZE, RES and SWAP are given in kilobytes),
408 STATE is the current state (one of
419 or the event on which the process waits),
420 C is the processor number on which the process is executing
421 (visible only on SMP systems),
422 TIME is the number of system and user cpu seconds that the process has used,
423 WCPU, when displayed, is the weighted cpu percentage (this is the same
427 CPU is the raw percentage and is the field that is sorted to determine
428 the order of the processes, and
429 COMMAND is the name of the command that the process is currently running
430 (if the process is swapped out, this column is marked
433 If a process is in the
438 the state column will report the name of the event or lock on which the
440 Lock names are prefixed with an asterisk
444 .Sh DESCRIPTION OF MEMORY
446 Mem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free
447 ARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other
448 15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead
449 Swap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out
451 .Ss Physical Memory Stats
452 .Bl -tag -width "Uncompressed" -compact
454 number of bytes active
456 number of clean bytes inactive
458 number of dirty bytes queued for laundering
460 number of bytes wired down, including IO-level cached file data pages
462 number of bytes used for IO-level disk caching
467 These stats are only displayed when the ARC is in use.
469 .Bl -tag -width "Uncompressed" -compact
471 number of wired bytes used for the ZFS ARC
473 number of ARC bytes holding most recently used data
475 number of ARC bytes holding most frequently used data
477 number of ARC bytes holding in flight data
479 number of ARC bytes holding headers
481 miscellaneous ARC bytes
483 bytes of memory used by ARC caches
485 bytes of data stored in ARC caches before compression
487 compression ratio of data cached in the ARC
490 .Bl -tag -width "Uncompressed" -compact
492 total available swap usage
494 total free swap usage
498 bytes paged in from swap devices (last interval)
500 bytes paged out to swap devices (last interval)
503 .Bl -tag -width "Uncompressed"
505 Default set of arguments to
508 The locale to use when displaying the
519 .Xr humanize_number 3 ,
523 .An William LeFebvre, EECS Department, Northwestern University
525 The command name for swapped processes should be tracked down, but this
526 would make the program run slower.
530 things can change while
532 is collecting information for an update.
533 The picture it gives is only a close approximation to reality.