TOP(1) — UNIX Programmer’s Manual
NAME
top − display and update information about the top cpu processes
SYNOPSIS
top [ −stime ] [ number ]
DESCRIPTION
Top displays the top 10 processes on the system and periodically updates this information. It uses raw cpu percentage to determine the top processes. The curses(3) package is used to do semi-optimal screen updating. If number is given, then the top number processes will be displayed instead of the default amount of 10. The −s option sets the delay between screen updates to time seconds. The default delay between updates is 5 seconds.
The top few lines of the display show general information about the state of the system, including the last process id assigned to a process, the three load averages, the current time, the number of existing processes, the number of processes in each state (sleeping, ABANDONED, running, starting, zombies, and stopped), and a percentage of time spent in each of the processor states (user, nice, system, and idle).
The remainder of the screen displays information about individual processes. This display is similar in spirit to ps(1) but it is not exactly the same. PID is the process id, USERNAME is the name of the process’s owner, PRI is the current priority of the process, NICE is the nice amount (in the range −20 to 20), SIZE is the total size of the process (text, data, and stack), RES is the current amount of resident memory (both SIZE and RES are given in kilobytes), STATE is the current state (one of “sleep”, “WAIT”, “run”, “idl”, “zomb”, or “stop”), TIME is the number of system and user cpu seconds that the process has used, WCPU is the weighted cpu percentage (this is the same value that ps(1) displays as CPU), CPU is the raw percentage and is the field that is sorted to determine the order of the processes, and COMMAND is the name of the command that the process is currently running (if the process is swapped out, this column is marked “<swapped>”).
NOTES
The “ABANDONED” state (known in the kernel as “SWAIT”) was abandoned, thus the name. A process should never end up in this state.
AUTHOR
William LeFebvre, Rice University graduate student
FILES
/dev/kmemkernel memory
/dev/memphysical memory
/vmunix system image
BUGS
The command name for swapped processes should be tracked down, but this would make the program run slower.
As with ps(1), things can change while top is collecting information for an update. The picture it gives is only a close approximation to reality.
SEE ALSO
4th Berkeley Distribution — Revision 1.1 of 15/12/89