xref: /freebsd/usr.bin/top/top.1 (revision 01e3140571bab1a7283e33669de171865cdb8028)
13be6ef06SEitan Adler.\" $FreeBSD$
2b8135ed6SMateusz Piotrowski.Dd November 18, 2021
39d6cce02SEitan Adler.Dt TOP 1
49d6cce02SEitan Adler.Os
59d6cce02SEitan Adler.Sh NAME
69d6cce02SEitan Adler.Nm top
79d6cce02SEitan Adler.Nd display and update information about the top cpu processes
89d6cce02SEitan Adler.Sh SYNOPSIS
99d6cce02SEitan Adler.Nm
1011253904SMateusz Piotrowski.Op Fl abCHIijnPpqSTtuvxz
119d6cce02SEitan Adler.Op Fl d Ar count
1211253904SMateusz Piotrowski.Op Fl J Ar jail
13c947fc5fSMateusz Piotrowski.Op Fl m Ar mode
149d6cce02SEitan Adler.Op Fl o Ar field
159d6cce02SEitan Adler.Op Fl p Ar pid
1611253904SMateusz Piotrowski.Op Fl s Ar time
1711253904SMateusz Piotrowski.Op Fl U Ar uid
181a444441SDimitry Andric.Op Ar number
199d6cce02SEitan Adler.Sh DESCRIPTION
209d6cce02SEitan Adler.Nm
213be6ef06SEitan Adlerdisplays the top
223be6ef06SEitan Adlerprocesses on the system and periodically updates this information.
233be6ef06SEitan AdlerIf standard output is an intelligent terminal (see below) then
243be6ef06SEitan Adleras many processes as will fit on the terminal screen are displayed
259d6cce02SEitan Adlerby default.
269d6cce02SEitan AdlerOtherwise, a good number of them are shown (around 20).
279d6cce02SEitan AdlerRaw cpu percentage is used to rank the processes.
289d6cce02SEitan AdlerIf
299d6cce02SEitan Adler.Ar number
303be6ef06SEitan Adleris given, then the top
319d6cce02SEitan Adler.Ar number
323be6ef06SEitan Adlerprocesses will be displayed instead of the default.
339d6cce02SEitan Adler.Pp
349d6cce02SEitan Adler.Nm
353be6ef06SEitan Adlermakes a distinction between terminals that support advanced capabilities
369d6cce02SEitan Adlerand those that do not.
379d6cce02SEitan AdlerThis distinction affects the choice of defaults for certain options.
38*01e31405SMateusz PiotrowskiIn the remainder of this document, an
39*01e31405SMateusz Piotrowski.Dq intelligent
40*01e31405SMateusz Piotrowskiterminal is one that
413be6ef06SEitan Adlersupports cursor addressing, clear screen, and clear to end of line.
42*01e31405SMateusz PiotrowskiConversely, a
43*01e31405SMateusz Piotrowski.Dq dumb
44*01e31405SMateusz Piotrowskiterminal is one that does not support such
459d6cce02SEitan Adlerfeatures.
469d6cce02SEitan AdlerIf the output of
479d6cce02SEitan Adler.Nm
483be6ef06SEitan Adleris redirected to a file, it acts as if it were being run on a dumb
493be6ef06SEitan Adlerterminal.
5011253904SMateusz Piotrowski.Pp
5111253904SMateusz PiotrowskiThe options are as follows:
5211253904SMateusz Piotrowski.Bl -tag -width indent
539d6cce02SEitan Adler.It Fl a
543be6ef06SEitan AdlerDisplay command names derived from the argv[] vector, rather than real
559d6cce02SEitan Adlerexecutable name.
569d6cce02SEitan AdlerIt it useful when you want to watch applications, that
579d6cce02SEitan Adlerputs their status information there.
589d6cce02SEitan AdlerIf the real name differs from argv[0],
593be6ef06SEitan Adlerit will be displayed in parenthesis.
60ecc2b89fSHiroki SatoNon-printable characters in the command line are
61ecc2b89fSHiroki Satoencoded in C-style backslash sequences or
62ecc2b89fSHiroki Satoa three digit octal sequences.
639d6cce02SEitan Adler.It Fl b
64*01e31405SMateusz PiotrowskiUse
65*01e31405SMateusz Piotrowski.Dq batch
66*01e31405SMateusz Piotrowskimode.
679d6cce02SEitan AdlerIn this mode, all input from the terminal is
689d6cce02SEitan Adlerignored.
699d6cce02SEitan AdlerInterrupt characters (such as ^C and ^\e) still have an effect.
703be6ef06SEitan AdlerThis is the default on a dumb terminal, or when the output is not a terminal.
7111253904SMateusz Piotrowski.It Fl C
7211253904SMateusz PiotrowskiToggle CPU display mode.
7311253904SMateusz PiotrowskiBy default top displays the weighted CPU percentage in the WCPU column
7411253904SMateusz Piotrowski(this is the same value that
7511253904SMateusz Piotrowski.Xr ps 1
7611253904SMateusz Piotrowskidisplays as CPU).
7711253904SMateusz PiotrowskiEach time
7811253904SMateusz Piotrowski.Fl C
79*01e31405SMateusz Piotrowskiflag is passed it toggles between
80*01e31405SMateusz Piotrowski.Dq raw cpu
81*01e31405SMateusz Piotrowskimode and
82*01e31405SMateusz Piotrowski.Dq weighted cpu
83*01e31405SMateusz Piotrowskimode, showing the
84*01e31405SMateusz Piotrowski.Dq CPU
85*01e31405SMateusz Piotrowskior the
86*01e31405SMateusz Piotrowski.Dq WCPU
87*01e31405SMateusz Piotrowskicolumn respectively.
8811253904SMateusz Piotrowski.It Fl d Ar count
8911253904SMateusz PiotrowskiShow only
9011253904SMateusz Piotrowski.Ar count
9111253904SMateusz Piotrowskidisplays, then exit.
9211253904SMateusz PiotrowskiA display is considered to be one update of the
9311253904SMateusz Piotrowskiscreen.
9411253904SMateusz PiotrowskiThe default is 1 for dumb terminals.
9511253904SMateusz PiotrowskiNote that for
9611253904SMateusz Piotrowski.Ar count
9711253904SMateusz Piotrowski= 1
9811253904SMateusz Piotrowskino information is available about the percentage of time spent by the CPU in every state.
999d6cce02SEitan Adler.It Fl H
1003be6ef06SEitan AdlerDisplay each thread for a multithreaded process individually.
1013be6ef06SEitan AdlerBy default a single summary line is displayed for each process.
10211253904SMateusz Piotrowski.It Fl I
10311253904SMateusz PiotrowskiDo not display idle processes.
10411253904SMateusz PiotrowskiBy default, top displays both active and idle processes.
1059d6cce02SEitan Adler.It Fl i
106*01e31405SMateusz PiotrowskiUse
107*01e31405SMateusz Piotrowski.Dq interactive
108*01e31405SMateusz Piotrowskimode.
1099d6cce02SEitan AdlerIn this mode, any input is immediately
1109d6cce02SEitan Adlerread for processing.
111*01e31405SMateusz PiotrowskiSee the section on
112*01e31405SMateusz Piotrowski.Dq Interactive Mode
1133be6ef06SEitan Adlerfor an explanation of
1149d6cce02SEitan Adlerwhich keys perform what functions.
1159d6cce02SEitan AdlerAfter the command is processed, the
1163be6ef06SEitan Adlerscreen will immediately be updated, even if the command was not
1179d6cce02SEitan Adlerunderstood.
1189d6cce02SEitan AdlerThis mode is the default when standard output is an
1193be6ef06SEitan Adlerintelligent terminal.
12011253904SMateusz Piotrowski.It Fl J Ar jail
12111253904SMateusz PiotrowskiShow only those processes owned by
12211253904SMateusz Piotrowski.Ar jail .
12311253904SMateusz PiotrowskiThis may be either the
12411253904SMateusz Piotrowski.Ar jid
12511253904SMateusz Piotrowskior
12611253904SMateusz Piotrowski.Ar name
12711253904SMateusz Piotrowskiof the jail.
12811253904SMateusz PiotrowskiUse
12911253904SMateusz Piotrowski0
13011253904SMateusz Piotrowskito limit to host processes.
13111253904SMateusz PiotrowskiUsing this option implies
13211253904SMateusz Piotrowski.Fl j .
1339d6cce02SEitan Adler.It Fl j
1343be6ef06SEitan AdlerDisplay the
1359d6cce02SEitan Adler.Xr jail 8
1363be6ef06SEitan AdlerID.
137c947fc5fSMateusz Piotrowski.It Fl m Ar mode
138c947fc5fSMateusz PiotrowskiDisplay statistics in the specified
139c947fc5fSMateusz Piotrowski.Ar mode .
140c947fc5fSMateusz PiotrowskiAvailable modes are
141c947fc5fSMateusz Piotrowski.Cm cpu
142c947fc5fSMateusz Piotrowskiand
143c947fc5fSMateusz Piotrowski.Cm io .
144c947fc5fSMateusz PiotrowskiDefault is
145c947fc5fSMateusz Piotrowski.Cm cpu .
1469d6cce02SEitan Adler.It Fl n
147*01e31405SMateusz PiotrowskiUse
148*01e31405SMateusz Piotrowski.Dq non-interactive
149*01e31405SMateusz Piotrowskimode.
150*01e31405SMateusz PiotrowskiThis is identical to
151*01e31405SMateusz Piotrowski.Dq batch
1523be6ef06SEitan Adlermode.
15311253904SMateusz Piotrowski.It Fl o Ar field
15411253904SMateusz PiotrowskiSort the process display area on the specified field.
15511253904SMateusz PiotrowskiThe field name
15611253904SMateusz Piotrowskiis the name of the column as seen in the output, but in lower case:
157*01e31405SMateusz Piotrowski.Dq cpu ,
158*01e31405SMateusz Piotrowski.Dq size ,
159*01e31405SMateusz Piotrowski.Dq res ,
160*01e31405SMateusz Piotrowski.Dq time ,
161*01e31405SMateusz Piotrowski.Dq pri ,
162*01e31405SMateusz Piotrowski.Dq threads ,
163*01e31405SMateusz Piotrowski.Dq total ,
164*01e31405SMateusz Piotrowski.Dq read ,
165*01e31405SMateusz Piotrowski.Dq write ,
166*01e31405SMateusz Piotrowski.Dq fault ,
167*01e31405SMateusz Piotrowski.Dq vcsw ,
168*01e31405SMateusz Piotrowski.Dq ivcsw ,
169*01e31405SMateusz Piotrowski.Dq jid ,
170*01e31405SMateusz Piotrowski.Dq swap ,
171*01e31405SMateusz Piotrowskior
172*01e31405SMateusz Piotrowski.Dq pid .
1739d6cce02SEitan Adler.It Fl P
1743be6ef06SEitan AdlerDisplay per-cpu CPU usage statistics.
17511253904SMateusz Piotrowski.It Fl p Ar pid
17611253904SMateusz PiotrowskiShow only the process
17711253904SMateusz Piotrowski.Ar pid .
1789d6cce02SEitan Adler.It Fl q
1793be6ef06SEitan AdlerRenice
1809d6cce02SEitan Adler.Nm
1819d6cce02SEitan Adlerto -20 so that it will run faster.
1829d6cce02SEitan AdlerThis can be used when the system is
1833be6ef06SEitan Adlerbeing very sluggish to improve the possibility of discovering the problem.
1843be6ef06SEitan AdlerThis option can only be used by root.
18511253904SMateusz Piotrowski.It Fl S
18611253904SMateusz PiotrowskiShow system processes in the display.
18711253904SMateusz PiotrowskiNormally, system processes such as the pager and the swapper are not shown.
18811253904SMateusz PiotrowskiThis option makes them visible.
18911253904SMateusz Piotrowski.It Fl s Ar time
19011253904SMateusz PiotrowskiSet the delay between screen updates to
19111253904SMateusz Piotrowski.Ar time
19211253904SMateusz Piotrowskiseconds, which may be fractional.
19311253904SMateusz PiotrowskiThe default delay between updates is 1 second.
19411253904SMateusz Piotrowski.It Fl T
19511253904SMateusz PiotrowskiToggle displaying thread ID (tid) instead of process id (pid).
19611253904SMateusz Piotrowski.It Fl t
19711253904SMateusz PiotrowskiDo not display the
19811253904SMateusz Piotrowski.Nm
19911253904SMateusz Piotrowskiprocess itself.
20011253904SMateusz Piotrowski.It Fl U Ar username
20111253904SMateusz PiotrowskiShow only those processes owned by
20211253904SMateusz Piotrowski.Ar username .
20311253904SMateusz PiotrowskiThis option currently only accepts usernames and will not understand
20411253904SMateusz Piotrowskiuid numbers.
2059d6cce02SEitan Adler.It Fl u
2069d6cce02SEitan AdlerDo not map uid numbers to usernames.
2079d6cce02SEitan AdlerNormally,
2089d6cce02SEitan Adler.Nm
209*01e31405SMateusz Piotrowskiwill read as much of the file
210*01e31405SMateusz Piotrowski.Pa /etc/passwd
211*01e31405SMateusz Piotrowskias is necessary to map
2129d6cce02SEitan Adlerall the user id numbers it encounters into login names.
2139d6cce02SEitan AdlerThis option disables all that, while possibly decreasing execution time.
2149d6cce02SEitan AdlerThe uid numbers are displayed instead of the names.
2159d6cce02SEitan Adler.It Fl v
2163be6ef06SEitan AdlerWrite version number information to stderr then exit immediately.
2179d6cce02SEitan Adler.It Fl w
2183be6ef06SEitan AdlerDisplay approximate swap usage for each process.
2199d6cce02SEitan Adler.It Fl z
2203be6ef06SEitan AdlerDo not display the system idle process.
2219d6cce02SEitan Adler.El
2229d6cce02SEitan Adler.Pp
2233be6ef06SEitan AdlerBoth
2249d6cce02SEitan Adler.Ar count
2253be6ef06SEitan Adlerand
2269d6cce02SEitan Adler.Ar number
227*01e31405SMateusz Piotrowskifields can be specified as
228*01e31405SMateusz Piotrowski.Dq infinite ,
229*01e31405SMateusz Piotrowskiindicating that they can
2309d6cce02SEitan Adlerstretch as far as possible.
2319d6cce02SEitan AdlerThis is accomplished by using any proper
2323be6ef06SEitan Adlerprefix of the keywords
233*01e31405SMateusz Piotrowski.Dq infinity ,
234*01e31405SMateusz Piotrowski.Dq maximum ,
2353be6ef06SEitan Adleror
236*01e31405SMateusz Piotrowski.Dq all .
2379d6cce02SEitan AdlerBoolean flags are toggles.
2389d6cce02SEitan AdlerA second specification of any of these options will negate the first.
2399d6cce02SEitan Adler.Sh "INTERACTIVE MODE"
2403be6ef06SEitan AdlerWhen
2419d6cce02SEitan Adler.Nm
242*01e31405SMateusz Piotrowskiis running in
243*01e31405SMateusz Piotrowski.Dq interactive mode ,
244*01e31405SMateusz Piotrowskiit reads commands from the
2459d6cce02SEitan Adlerterminal and acts upon them accordingly.
2469d6cce02SEitan AdlerIn this mode, the terminal is
247*01e31405SMateusz Piotrowskiput in
248*01e31405SMateusz Piotrowski.Dq CBREAK ,
249*01e31405SMateusz Piotrowskiso that a character will be
2509d6cce02SEitan Adlerprocessed as soon as it is typed.
2519d6cce02SEitan AdlerAlmost always, a key will be
2523be6ef06SEitan Adlerpressed when
2539d6cce02SEitan Adler.Nm
2543be6ef06SEitan Adleris between displays; that is, while it is waiting for
2559d6cce02SEitan Adler.Ar time
2569d6cce02SEitan Adlerseconds to elapse.
2579d6cce02SEitan AdlerIf this is the case, the command will be
2583be6ef06SEitan Adlerprocessed and the display will be updated immediately thereafter
2599d6cce02SEitan Adler(reflecting any changes that the command may have specified).
2609d6cce02SEitan AdlerThis
2619d6cce02SEitan Adlerhappens even if the command was incorrect.
2629d6cce02SEitan AdlerIf a key is pressed while
2639d6cce02SEitan Adler.Nm
2643be6ef06SEitan Adleris in the middle of updating the display, it will finish the update and
2659d6cce02SEitan Adlerthen process the command.
2669d6cce02SEitan AdlerSome commands require additional information,
2679d6cce02SEitan Adlerand the user will be prompted accordingly.
2689d6cce02SEitan AdlerWhile typing this information
2693be6ef06SEitan Adlerin, the user's erase and kill keys (as set up by the command
2709d6cce02SEitan Adler.Xr stty 1 )
2713be6ef06SEitan Adlerare recognized, and a newline terminates the input.
2729d6cce02SEitan Adler.Pp
2733be6ef06SEitan AdlerThese commands are currently recognized (^L refers to control-L):
2749d6cce02SEitan Adler.Bl -tag -width indent
2759d6cce02SEitan Adler.It ^L
2763be6ef06SEitan AdlerRedraw the screen.
2779d6cce02SEitan Adler.It h
2789d6cce02SEitan AdlerDisplay a summary of the commands (help screen).
2799d6cce02SEitan AdlerVersion information
2803be6ef06SEitan Adleris included in this display.
2819d6cce02SEitan Adler.It q
2823be6ef06SEitan AdlerQuit
2839d6cce02SEitan Adler.Nm
2849d6cce02SEitan Adler.It d
2853be6ef06SEitan AdlerChange the number of displays to show (prompt for new number).
28611253904SMateusz PiotrowskiRemember that the next display counts as one, so typing 'd1' will make
2879d6cce02SEitan Adler.Nm
2883be6ef06SEitan Adlershow one final display and then immediately exit.
289a00d703fSJohn Grafton.It /
290a00d703fSJohn GraftonDisplay only processes that contain the specified string in their
291a00d703fSJohn Graftoncommand name.
292a00d703fSJohn GraftonIf displaying arguments is enabled, the arguments are searched
293a00d703fSJohn Graftontoo. '+' shows all processes.
2949d6cce02SEitan Adler.It m
2953be6ef06SEitan AdlerToggle the display between 'cpu' and 'io' modes.
2969d6cce02SEitan Adler.It n or #
2973be6ef06SEitan AdlerChange the number of processes to display (prompt for new number).
2989d6cce02SEitan Adler.It s
2993be6ef06SEitan AdlerChange the number of seconds to delay between displays
3003be6ef06SEitan Adler(prompt for new number).
3019d6cce02SEitan Adler.It S
3023be6ef06SEitan AdlerToggle the display of system processes.
3039d6cce02SEitan Adler.It a
3043be6ef06SEitan AdlerToggle the display of process titles.
3059d6cce02SEitan Adler.It k
306*01e31405SMateusz PiotrowskiSend a signal
307*01e31405SMateusz Piotrowski.Pq SIGKILL by default
308*01e31405SMateusz Piotrowskito a list of processes.
3093be6ef06SEitan AdlerThis acts similarly to the command
3109d6cce02SEitan Adler.Xr kill 1 .
3119d6cce02SEitan Adler.It r
312*01e31405SMateusz PiotrowskiChange the priority
313*01e31405SMateusz Piotrowski.Pq the Dq nice
314*01e31405SMateusz Piotrowskiof a list of processes.
3159d6cce02SEitan AdlerThis acts similarly to
3169d6cce02SEitan Adler.Xr renice 8 .
3179d6cce02SEitan Adler.It u
3183be6ef06SEitan AdlerDisplay only processes owned by a specific set of usernames (prompt for
3199d6cce02SEitan Adlerusername).
320*01e31405SMateusz PiotrowskiIf the username specified is simply
321*01e31405SMateusz Piotrowski.Dq +
322*01e31405SMateusz Piotrowskior
323*01e31405SMateusz Piotrowski.Dq - ,
3249d6cce02SEitan Adlerthen processes belonging to all users will be displayed.
3259d6cce02SEitan AdlerUsernames can be added
326*01e31405SMateusz Piotrowskito and removed from the set by prepending them with
327*01e31405SMateusz Piotrowski.Dq +
328*01e31405SMateusz Piotrowskiand
329*01e31405SMateusz Piotrowski.Dq - ,
330*01e31405SMateusz Piotrowskirespectively.
3319d6cce02SEitan Adler.It o
3329d6cce02SEitan AdlerChange the order in which the display is sorted.
3339d6cce02SEitan AdlerThe sort key names include
334*01e31405SMateusz Piotrowski.Dq cpu ,
335*01e31405SMateusz Piotrowski.Dq res ,
336*01e31405SMateusz Piotrowski.Dq size ,
337*01e31405SMateusz Piotrowskiand
338*01e31405SMateusz Piotrowski.Dq time.
3399d6cce02SEitan AdlerThe default is cpu.
3409d6cce02SEitan Adler.It p
34151b29cb7SRoman BogorodskiyDisplay a specific process (prompt for pid).
342*01e31405SMateusz PiotrowskiIf the pid specified is simply
343*01e31405SMateusz Piotrowski.Dq + ,
344*01e31405SMateusz Piotrowskithen show all processes.
3459d6cce02SEitan Adler.It e
3463be6ef06SEitan AdlerDisplay a list of system errors (if any) generated by the last
3473be6ef06SEitan Adlercommand.
348b8135ed6SMateusz Piotrowski.It H
3493be6ef06SEitan AdlerToggle the display of threads.
3509d6cce02SEitan Adler.It i or I
3513be6ef06SEitan AdlerToggle the display of idle processes.
3529d6cce02SEitan Adler.It j
3533be6ef06SEitan AdlerToggle the display of
3549d6cce02SEitan Adler.Xr jail 8
3553be6ef06SEitan AdlerID.
3569d6cce02SEitan Adler.It J
3573be6ef06SEitan AdlerDisplay only processes owned by a specific jail (prompt for jail).
358*01e31405SMateusz PiotrowskiIf the jail specified is simply
359*01e31405SMateusz Piotrowski.Dq + ,
360*01e31405SMateusz Piotrowskithen processes belonging
3613be6ef06SEitan Adlerto all jails and the host will be displayed.
3623be6ef06SEitan AdlerThis will also enable the display of JID.
3639d6cce02SEitan Adler.It P
3643be6ef06SEitan AdlerToggle the display of per-CPU statistics.
3659d6cce02SEitan Adler.It T
3669d6cce02SEitan AdlerToggle display of TID and PID
3679d6cce02SEitan Adler.It t
3683be6ef06SEitan AdlerToggle the display of the
3699d6cce02SEitan Adler.Nm
3703be6ef06SEitan Adlerprocess.
3719d6cce02SEitan Adler.It w
3723be6ef06SEitan AdlerToggle the display of swap usage.
3739d6cce02SEitan Adler.It z
3743be6ef06SEitan AdlerToggle the display of the system idle process.
3759d6cce02SEitan Adler.El
3769d6cce02SEitan Adler.Sh "THE DISPLAY"
3773be6ef06SEitan AdlerThe top few lines of the display show general information
3783be6ef06SEitan Adlerabout the state of the system, including
3793be6ef06SEitan Adlerthe last process id assigned to a process (on most systems),
3803be6ef06SEitan Adlerthe three load averages,
3813be6ef06SEitan Adlerthe current time,
3823be6ef06SEitan Adlerthe number of existing processes,
3833be6ef06SEitan Adlerthe number of processes in each state
3843be6ef06SEitan Adler(sleeping, running, starting, zombies, and stopped),
3853be6ef06SEitan Adlerand a percentage of time spent in each of the processor states
3863be6ef06SEitan Adler(user, nice, system, and idle).
3873be6ef06SEitan AdlerIt also includes information about physical and virtual memory allocation.
3889d6cce02SEitan Adler.Pp
3893be6ef06SEitan AdlerThe remainder of the screen displays information about individual
3909d6cce02SEitan Adlerprocesses.
3919d6cce02SEitan AdlerThis display is similar in spirit to
3929d6cce02SEitan Adler.Xr ps 1
3939d6cce02SEitan Adlerbut it is not exactly the same.
3949d6cce02SEitan AdlerPID is the process id,
3953be6ef06SEitan AdlerJID, when displayed, is the
3969d6cce02SEitan Adler.Xr jail 8
3973be6ef06SEitan AdlerID corresponding to the process,
3983be6ef06SEitan AdlerUSERNAME is the name of the process's owner (if
3999d6cce02SEitan Adler.Fl u
4003be6ef06SEitan Adleris specified, a UID column will be substituted for USERNAME),
4013be6ef06SEitan AdlerPRI is the current priority of the process,
4029d6cce02SEitan AdlerNICE is the
4039d6cce02SEitan Adler.Xr nice 1
4049d6cce02SEitan Adleramount,
4053be6ef06SEitan AdlerSIZE is the total size of the process (text, data, and stack),
4063be6ef06SEitan AdlerRES is the current amount of resident memory,
4073be6ef06SEitan AdlerSWAP is the approximate amount of swap, if enabled
4083be6ef06SEitan Adler(SIZE, RES and SWAP are given in kilobytes),
409*01e31405SMateusz PiotrowskiSTATE is the current state (one of
410*01e31405SMateusz Piotrowski.Dq START ,
411*01e31405SMateusz Piotrowski.Dq RUN
412*01e31405SMateusz Piotrowski(shown as
413*01e31405SMateusz Piotrowski.Dq CPUn
414*01e31405SMateusz Piotrowskion SMP systems),
415*01e31405SMateusz Piotrowski.Dq SLEEP ,
416*01e31405SMateusz Piotrowski.Dq STOP ,
417*01e31405SMateusz Piotrowski.Dq ZOMB ,
418*01e31405SMateusz Piotrowski.Dq WAIT ,
419*01e31405SMateusz Piotrowski.Dq LOCK ,
420*01e31405SMateusz Piotrowskior the event on which the process waits),
4213be6ef06SEitan AdlerC is the processor number on which the process is executing
4223be6ef06SEitan Adler(visible only on SMP systems),
4233be6ef06SEitan AdlerTIME is the number of system and user cpu seconds that the process has used,
4243be6ef06SEitan AdlerWCPU, when displayed, is the weighted cpu percentage (this is the same
4253be6ef06SEitan Adlervalue that
4269d6cce02SEitan Adler.Xr ps 1
4273be6ef06SEitan Adlerdisplays as CPU),
4283be6ef06SEitan AdlerCPU is the raw percentage and is the field that is sorted to determine
4293be6ef06SEitan Adlerthe order of the processes, and
4303be6ef06SEitan AdlerCOMMAND is the name of the command that the process is currently running
431*01e31405SMateusz Piotrowski(if the process is swapped out, this column is marked
432*01e31405SMateusz Piotrowski.Dq <swapped> ) .
4339d6cce02SEitan Adler.Pp
434*01e31405SMateusz PiotrowskiIf a process is in the
435*01e31405SMateusz Piotrowski.Dq SLEEP
436*01e31405SMateusz Piotrowskior
437*01e31405SMateusz Piotrowski.Dq LOCK
438*01e31405SMateusz Piotrowskistate,
4393be6ef06SEitan Adlerthe state column will report the name of the event or lock on which the
4403be6ef06SEitan Adlerprocess is waiting.
441*01e31405SMateusz PiotrowskiLock names are prefixed with an asterisk
442*01e31405SMateusz Piotrowski.Dq *
443*01e31405SMateusz Piotrowskiwhile sleep events
4443be6ef06SEitan Adlerare not.
445fab44dc3SMateusz Piotrowski.Sh DESCRIPTION OF MEMORY
446fab44dc3SMateusz Piotrowski.Bd -literal
447fab44dc3SMateusz PiotrowskiMem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free
448fab44dc3SMateusz PiotrowskiARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other
449fab44dc3SMateusz Piotrowski     15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead
450fab44dc3SMateusz PiotrowskiSwap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out
451fab44dc3SMateusz Piotrowski.Ed
452fab44dc3SMateusz Piotrowski.Ss Physical Memory Stats
453fab44dc3SMateusz Piotrowski.Bl -tag -width "Uncompressed" -compact
454fab44dc3SMateusz Piotrowski.It Em Active
455fab44dc3SMateusz Piotrowskinumber of bytes active
456fab44dc3SMateusz Piotrowski.It Em Inact
457fab44dc3SMateusz Piotrowskinumber of clean bytes inactive
458fab44dc3SMateusz Piotrowski.It Em Laundry
459fab44dc3SMateusz Piotrowskinumber of dirty bytes queued for laundering
460fab44dc3SMateusz Piotrowski.It Em Wired
461fab44dc3SMateusz Piotrowskinumber of bytes wired down, including IO-level cached file data pages
462fab44dc3SMateusz Piotrowski.It Em Buf
463fab44dc3SMateusz Piotrowskinumber of bytes used for IO-level disk caching
464fab44dc3SMateusz Piotrowski.It Em Free
465fab44dc3SMateusz Piotrowskinumber of bytes free
466fab44dc3SMateusz Piotrowski.El
467fab44dc3SMateusz Piotrowski.Ss ZFS ARC Stats
468fab44dc3SMateusz PiotrowskiThese stats are only displayed when the ARC is in use.
4699d6cce02SEitan Adler.Pp
470fab44dc3SMateusz Piotrowski.Bl -tag -width "Uncompressed" -compact
471fab44dc3SMateusz Piotrowski.It Em Total
472fab44dc3SMateusz Piotrowskinumber of wired bytes used for the ZFS ARC
473fab44dc3SMateusz Piotrowski.It Em MRU
474fab44dc3SMateusz Piotrowskinumber of ARC bytes holding most recently used data
475fab44dc3SMateusz Piotrowski.It Em MFU
476fab44dc3SMateusz Piotrowskinumber of ARC bytes holding most frequently used data
477fab44dc3SMateusz Piotrowski.It Em Anon
478fab44dc3SMateusz Piotrowskinumber of ARC bytes holding in flight data
479fab44dc3SMateusz Piotrowski.It Em Header
480fab44dc3SMateusz Piotrowskinumber of ARC bytes holding headers
481fab44dc3SMateusz Piotrowski.It Em Other
482fab44dc3SMateusz Piotrowskimiscellaneous ARC bytes
483fab44dc3SMateusz Piotrowski.It Em Compressed
484fab44dc3SMateusz Piotrowskibytes of memory used by ARC caches
485fab44dc3SMateusz Piotrowski.It Em Uncompressed
486fab44dc3SMateusz Piotrowskibytes of data stored in ARC caches before compression
487fab44dc3SMateusz Piotrowski.It Em Ratio
488fab44dc3SMateusz Piotrowskicompression ratio of data cached in the ARC
489fab44dc3SMateusz Piotrowski.El
490fab44dc3SMateusz Piotrowski.Ss Swap Stats
491fab44dc3SMateusz Piotrowski.Bl -tag -width "Uncompressed" -compact
492fab44dc3SMateusz Piotrowski.It Em Total
493fab44dc3SMateusz Piotrowskitotal available swap usage
494fab44dc3SMateusz Piotrowski.It Em Free
495fab44dc3SMateusz Piotrowskitotal free swap usage
496fab44dc3SMateusz Piotrowski.It Em Inuse
497fab44dc3SMateusz Piotrowskiswap usage
498fab44dc3SMateusz Piotrowski.It Em \&In
499fab44dc3SMateusz Piotrowskibytes paged in from swap devices (last interval)
500fab44dc3SMateusz Piotrowski.It Em Out
501fab44dc3SMateusz Piotrowskibytes paged out to swap devices (last interval)
502fab44dc3SMateusz Piotrowski.El
5039d6cce02SEitan Adler.Sh ENVIRONMENT
504fab44dc3SMateusz Piotrowski.Bl -tag -width "Uncompressed"
505fab44dc3SMateusz Piotrowski.It Ev TOP
5069d6cce02SEitan AdlerDefault set of arguments to
5079d6cce02SEitan Adler.Nm .
508ecc2b89fSHiroki Sato.It Ev LC_CTYPE
509ecc2b89fSHiroki SatoThe locale to use when displaying the
510ecc2b89fSHiroki Sato.Va argv
511ecc2b89fSHiroki Satovector when
512ecc2b89fSHiroki Sato.Fl a
513ecc2b89fSHiroki Satoflag is specified.
5149d6cce02SEitan Adler.El
5159d6cce02SEitan Adler.Sh SEE ALSO
5169d6cce02SEitan Adler.Xr kill 1 ,
5179d6cce02SEitan Adler.Xr ps 1 ,
5189d6cce02SEitan Adler.Xr stty 1 ,
5199d6cce02SEitan Adler.Xr getrusage 2 ,
5209d6cce02SEitan Adler.Xr humanize_number 3 ,
5219d6cce02SEitan Adler.Xr mem 4 ,
5229d6cce02SEitan Adler.Xr renice 8
523fab44dc3SMateusz Piotrowski.Sh AUTHORS
524fab44dc3SMateusz Piotrowski.An William LeFebvre, EECS Department, Northwestern University
525fab44dc3SMateusz Piotrowski.Sh BUGS
526fab44dc3SMateusz PiotrowskiThe command name for swapped processes should be tracked down, but this
527fab44dc3SMateusz Piotrowskiwould make the program run slower.
528fab44dc3SMateusz Piotrowski.Pp
529fab44dc3SMateusz PiotrowskiAs with
530fab44dc3SMateusz Piotrowski.Xr ps 1 ,
531fab44dc3SMateusz Piotrowskithings can change while
532fab44dc3SMateusz Piotrowski.Nm
533fab44dc3SMateusz Piotrowskiis collecting information for an update.
534fab44dc3SMateusz PiotrowskiThe picture it gives is only a close approximation to reality.
535