Top (software)
Template:Short description Template:Lowercase Template:Infobox software top is a task manager or system monitor program, found in many Unix-like operating systems, that displays information about CPU and memory utilization.
Overview
The program produces an ordered list of running processes selected by user-specified criteria, and updates it periodically. Default ordering is by CPU usage, and only the top CPU consumers are shown (hence the name). top shows how much processing power and memory are being used, as well as other information about the running processes. Some versions of top allow extensive customization of the display, such as choice of columns or sorting method. top is useful for system administrators, as it shows which users and processes are consuming the most system resources at any given time.
Implementations
There are several different versions of top. The traditional Unix version was written by William LeFebvre and originally copyrighted in 1984.<ref>Template:Cite web</ref> It is hosted on SourceForge,<ref>Template:Cite web</ref> and release 3.7 was announced in 2008.<ref>Template:Cite web</ref>
The Linux version of top is part of the procps-ng group of tools. It was originally written by Roger Binns<ref>Template:Cite web</ref> and released in early 1992 but shortly thereafter taken over by others.<ref>Template:Cite web</ref>
On Solaris, the roughly equivalent program is prstat. Microsoft Windows has the tasklist command and the graphical Task Manager utility. IBM AIX has an updating running processes list as part of the topas and topas_nmon commands.
The load average numbers in Linux refers to the sum of the number of processes waiting in the run-queue plus the number currently executing. The number is absolute, not relative. And thus it can be unbounded; unlike utilization. The instant variations of the number of processes are damped with an exponential decay formula which is calculated using fixed point math.<ref name="tq_ldavg2">Template:Cite web</ref>
The ps program is similar to top, but instead produces a snapshot of processes taken at the time of invocation. top's Template:Mono (number of iterations) option can product a similar result, causing the program to run the specified number of iterations, then exit after printing its output.
Example
The first 5 rows overview the entire system.
[[Load (computing)|Template:Vanchor]]- The exponential moving average of the run-queue length over the past 1/5/15 minutes. The run-queue includes both processes being run and waiting to be run. At complete utilization with no task switching, the load average is equal to the number of CPUs.<ref name="drdobbs">Template:Cite web</ref>
Template:Vanchor- counts the processes their statuses.
Template:Vanchor- counts the percentage of CPU usage, broken down into categories.
Template:Vanchor- Memory usage in units of mebibyte. The
buff/cacheis for memory used by buffers and cache. Template:Vanchor- Swap space usage in units of mebibyte. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. In this snapshot, there's a total of Template:Val of swap, all free, indicating that no swapping is occurring, which is good for performance.
Template:Vanchor- The amount of memory available for new applications, without swapping. This considers not just the unused RAM, but also the memory that can be reclaimed from RAM caches.
The rest of the text provides a table with each row being a process, with the following columns often used out of many possible columns (the choice and ordering of columns are configurable):<ref>top(1) - Linux man page</ref>
Template:Vanchor- Process ID, a unique number identifying each running process.
Template:Vanchor- The user who started the process. If the username is too long, it is cut-off with a
+at the end. Template:Vanchor- Real-time priority of the task, computed by the system scheduler. Lower PR numbers are considered more important by the scheduler and more likely to be scheduled, which means it tends to have more CPU-time per real-time.
Template:Vanchor- The niceness of the task, manually set by users and administrators to influence the real-time priority. A lower nice value tends to favor the process, and a higher nice value tends to disfavor the process. It ranges from -20 (most favored) to 19 (least favored).
Template:Vanchor- Virtual memory size of the process. This includes all memory that the process can access, including memory that is swapped out, memory that is allocated but not used, and shared memory.
Template:Vanchor- Resident set size, the portion of a process's memory that is held in RAM. Compared with
Template:Vanchor, this excludes memory that is swapped out, not yet used, or shared. Template:Vanchor- Shared memory size: how much of the RAM claimed by the process is sharable with other processes.
Template:Vanchor- Status of process. The status can be:
- Template:Aligned table
Template:Vanchor- The percentage of the CPU time that the process is currently using.
Template:Vanchor- The percentage of the physical RAM used by the process.
Template:Vanchor- The total CPU time the task has used since it started. This is shown in
minutes:seconds. The plus sign inTIME+means that it is accurate to 0.01 second. If it showsTIMEthen it is accurate to 1 second. Template:Vanchor- The command line argument that started the process. Unlike
USER, if the command is too long, it is cut-off without a+at the end.
See also
References
External links
- Template:Man
- Template:Man
- Template:Man
- Template:Cite web. A deep dive into the mechanics of
top. - Template:Cite web