How to look at output of top command

The following screen will be shown by default (of Debian 12). This post describes the important three information surrounded by the red boxes.

(1) CPU execution time

The percentage of each execution type is displayed here, with the sum of all CPUs as 100%.
Type Description
us Execution time in user mode. Time for normal processing of the program.
sy Program execution time in kernel mode. The time that code in the kernel is executed when a program calls a system call. (This corresponds to reading and writing files, network processing, etc.)
ni Program execution time for processes with positive NICE values and low priority
id Idle time. Time when nothing is running.
wa Time spent waiting for a response from a device. E.g. an input/output process to a device such as storage.
hi Execution time of hardware interrupt processing
si Execution time of software interrupt processing
st Time a virtual CPU on a hypervisor-type virtual machine waits for physical CPU allocation

(2) Memory usage

Shows the total amount of memory used by the OS. The default unit is MiB.
Group Item Description
Mem total Total memory size
free Free memory size
used Used memory size
buff/cache Cache space size for directory entries and file contents; Linux actively allocates free memory to these caches, so these values tend to increase as free memory decreases with use.
Swap total Total swap size
free Free swap size
used Used swap size
avail Mem Available memory size. Roughly speaking, sum of the free memory size and the cache size.

(3) Each process status

The following table sumarizes the meaning of each column of the header. Processes are shown in descending order by default. The default unit of memory related items is KiB.  
Item Description
PID Process ID
USER The executioni user of the process
PR Execution priority of the process. The normal is 20. The smaller the number, the higher the priority.
NI NICE value. When this value is positive, it is executed at a low priority according to its value. When it is negative, it is executed at a high priority according to its value.
VIRT Virtual memory usage. Amount of memory allocated by the process. Only a portion of this value is allocated to physical memory. Even if this value is large, not much memory may be used.
RES Physical memory usage. Amount of physical memory allocated to the process. Actual memory usage for the process.
SHR Shared memory usage, the amount of memory in the RES that is shared with other processes.
S Process state: R (running), S (sleep), D (uninterruptible sleep), Z (zombie state)
%CPU CPU utilization. 100% when one CPU is fully used. This value may exceed 100% when multiple CPUs are used.
%MEM Memory utilization
TIME+ CPU usage time of the process. The total time that the CPU has been allocated (i.e., the process's program has been executed), not the time since it was started, in units of 1/100th of a second.
Example: 1:23.45 means 1 minute 23 seconds 450 milliseconds
COMMAND Exection command

No comments:

Post a Comment