TOP is a dynamic display process, that is, the current state can be continuously refreshed by the user's keystrokes. If the command is executed in the foreground, it will occupy the foreground until the user terminates the program. More precisely, the top command provides real-time feedback to the system. Status monitoring of the processor. It will display a list of the most "sensitive" tasks for the CPU in the system. This command can sort tasks by CPU usage, memory usage and execution time; and many features of this command are available through interactive commands or The settings are made in the personal customization file.
top - 12:38:33 up 50 days, 23:15, 7 users, load average: 60.58, 61.14, 61.22
Tasks: 203 total, 60 running, 139 sleeping, 4 stopped, 0 zombie
Cpu (s): 27.0%us, 73.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1939780k total, 1375280k used, 564500k free, 109680k buffers
Swap: 4401800k total, 497456k used, 3904344k free, 848712k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4338 oracle 25 0 627m 209m 207m R 0 11.0 297:14.76 oracle
4267 oracle 25 0 626m 144m 143m R 6 7.6 89:16.62 oracle
3458 oracle 25 0 672m 133m 124m R 0 7.1 1283:08 oracle
3478 oracle 25 0 672m 124m 115m R 0 6.6 1272:30 oracle
3395 oracle 25 0 672m 122m 113m R 0 6.5 1270:03 oracle
3480 oracle 25 0 672m 122m 109m R 8 6.4 1274:13 oracle
3399 oracle 25 0 672m 121m 110m R 0 6.4 1279:37 oracle
4261 oracle 25 0 634m 100m 99m R 0 5.3 86:13.90 oracle
25737 oracle 25 0 632m 81m 74m R 0 4.3 272:35.42 oracle
7072 oracle 25 0 626m 72m 71m R 0 3.8 6:35.68 oracle
16073 oracle 25 0 630m 68m 63m R 8 3.6 175:20.36 oracle
16140 oracle 25 0 630m 66m 60m R 0 3.5 175:13.42 oracle
16122 oracle 25 0 630m 66m 60m R 0 3.5 176:47.73 oracle
786 oracle 25 0 627m 63m 63m R 0 3.4 1:54.93 oracle
4271 oracle 25 0 627m 59m 58m R 8 3.1 86:09.64 oracle
4273 oracle 25 0 627m 57m 56m R 8 3.0 84:38.20 oracle
22670 oracle 25 0 626m 50m 49m R 0 2.7 84:55.82 oracle
1. TOP top five statistical information
The first five lines of the statistical information area are the overall statistical information of the system.
1. The first line is the task queue information
The execution result of the same uptime command:
[root@localhost ~]# uptime
13:22:30 up 8 min, 4 users, load average: 0.14, 0.38, 0.25
Its contents are as follows:
12:38:33 |
current time |
up 50days |
System running time, in the format of hours:minutes |
1 user |
Number of currently logged in users |
load average: 0.06, 0.60, 0.48 |
System load, which is the average length of the task queue. The three values are the average values from 1 minute, 5 minutes, and 15 minutes ago to the present. |
2. The second and third behaviors are process and CPU information
These may exceed two lines when there are multiple CPUs. The content is as follows:
Tasks: 29 total |
total number of processes |
1 running |
Number of running processes |
28 sleeping |
number of sleeping processes |
0 stopped |
Number of stopped processes |
0 zombie |
Number of zombie processes |
Cpu(s): 0.3% us |
User space usage percentage of CPU |
1.0% sy |
The percentage of CPU used by kernel space |
0.0% ni |
Percentage of CPU occupied by processes that have changed priorities in user process space |
98.7% id |
Idle CPU percentage |
0.0% wa |
Percentage of CPU time waiting for input and output |
0.0% hi |
|
0.0% yes |
3. The fourth and fifth rows are memory information.
The content is as follows:
Mem: 191272k total |
total physical memory |
173656k used |
Total physical memory used |
17616k free |
total free memory |
22052k buffers |
Amount of memory used as kernel cache |
Swap: 192772k total |
Total swap area |
0k used |
The total amount of swap area used |
192772k free |
Total amount of free swap area |
123988k cached |
The total amount of buffered swap area. The content in the memory is swapped out to the swap area, and then swapped into the memory, but the used swap area has not been overwritten, and this value is the size of the swap area where these contents already exist in the memory . When the corresponding memory is swapped out again, there is no need to write to the swap area. |
2. Process information
column name |
meaning |
PID |
process id |
PPID |
parent process id |
RUSER |
Real user name |
UID |
User id of the process owner |
USER |
Username of the process owner |
GROUP |
The group name of the process owner |
TTY |
The name of the terminal from which the process was started. Processes not started from a terminal are displayed as ? |
PR |
priority |
NI |
nice value. Negative values indicate high priority, positive values indicate low priority |
P |
Last CPU used, only meaningful in multi-CPU environments |
%CPU |
The percentage of CPU time used since the last update |
TIME |
The total CPU time used by the process, in seconds |
TIME+ |
进程使用的CPU时间总计,单位1/100秒 |
%MEM |
进程使用的物理内存百分比 |
VIRT |
进程使用的虚拟内存总量,单位kb。VIRT=SWAP+RES |
SWAP |
进程使用的虚拟内存中,被换出的大小,单位kb。 |
RES |
进程使用的、未被换出的物理内存大小,单位kb。RES=CODE+DATA |
CODE |
可执行代码占用的物理内存大小,单位kb |
DATA |
可执行代码以外的部分(数据段+栈)占用的物理内存大小,单位kb |
SHR |
共享内存大小,单位kb |
nFLT |
页面错误次数 |
nDRT |
最后一次写入到现在,被修改过的页面数。 |
S |
进程状态。 |
COMMAND |
命令名/命令行 |
WCHAN |
若该进程在睡眠,则显示睡眠中的系统函数名 |
Flags |
任务标志,参考 sched.h |