NAME
top—Display top CPU processes

SYNOPSIS
top [-][ddelay][q][S][s][i]

DESCRIPTION
top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes.

COMMAND-LINE OPTIONS

Options Description
d Specifies the delay between screen updates. You can change this with the s interactive command.
q This causes top to refresh without any delay. If the caller has superuser privileges, top runs with the highest possible priority.
S Specifies cumulative mode, where each process is listed with the CPU time that it as well as its dead children has spent. This is like the -S flag to ps(1). See the discussion of the S interactive command later in this manual page.
s Tells top to run in secure mode. This disables the potentially dangers of the interactive commands. (See “Interactive Commands,” later in this manual page.) A secure top is a nifty thing to leave running on a spare terminal.
i Start top, ignoring any idle or zombie processes. (See the interactive command i.)

FIELD DESCRIPTIONS
top displays a variety of information about the processor state. The display is updated every five seconds by default, but you can change that with the d command-line option or the s interactive command.

Field Descriptions
uptime This line displays the time the system has been up, and the three load averages for the system. The load averages are the average number of process ready to run during the last 1, 5, and 15 minutes. This line is just like the output of uptime(1).
processes The total number of processes running at the time of the last update. This is also broken down into the number of tasks that are running, sleeping, stopped, or undead.
CPU states Shows the percentage of CPU time in user mode, system mode, niced tasks, and idle. (Niced tasks are only those whose nice value is negative.) Time spent in niced tasks will also be counted in system and user time, so the total will be more than 100 percent.
Mem Statistics on memory usage, including total available memory, free memory, used memory, shared memory, and memory used for buffers.
Swap Statistics on swap space, including total swap space, available swap space, and used swap space. This and Mem are just like the output of free(1).
PID The process ID of each task.
USER The username of the task’s owner.
PRI The priority of the task.
NI The nice value of the task. Negative nice values are lower priority.
SIZE The size of the task’s code plus data plus stack space, in kilobytes, is shown here.
RSS The total amount of physical memory used by the task, in kilobytes, is shown here.
SHRD The amount of shared memory used by the task is shown in this column.
ST The state of the task is shown here. The state is either S for sleeping, D for uninterruptible sleep, R for running, Z for zombies, or T for stopped or traced.
TIME Total CPU time the task has used since it started. If cumulative mode is on, this also includes the CPU time used by the process’s children that have died. You can set cumulative mode with the S command-line option or toggle it with the interactive command S.
%CPU The task’s share of the CPU time since the last screen update, expressed as a percentage of total CPU time.
%MEM The task’s share of the physical memory.
COMMAND The task’s command name, which will be truncated if it is too long to be displayed on one line. Tasks in memory will have a full command line, but swapped-out tasks will only have the name of the program in parentheses, for example, (getty).

NOTES
This proc-based top works by reading the files in the proc filesystem, mounted on /proc. If /proc is not mounted, top will not work.

%CPU shows the cputime/realtime percentage in the period of time between updates. For the first update, a short delay is used, and top itself dominates the CPU usage. After that, top will drop back, and a more reliable estimate of CPU usage is available.

The SIZE and RSS fields don’t count the page tables and the task struct of a process; this is at least 12K of memory that is always resident. SIZE is the virtual size of the process (code+data+stack).

Keep in mind that a process must die for its time to be recorded on its parent by cumulative mode. Perhaps more useful behavior would be to follow each process upwards, adding time, but that would be more expensive, possibly prohibitively so. In any case, that would make top’s behavior incompatible with ps.

If You Like What We Do Here On LinuxConcept, You Should Consider:

Stay Connected to: Twitter | Facebook

Subscribe to our email updates: Sign Up Now

 

We are thankful for your support.

Follow me