Home > Article > Operation and Maintenance > How to check memory usage in Linux?
Input: top
##PID |
Process ID |
USER |
Process Owner |
PR |
The priority level of the process, the smaller it is, the priority it will be executed |
Ninice |
##Value
|
##VIRT ##Virtual virtual space occupied by the process Memory |
|
Physical memory occupied by the process |
|
Shared memory used by the process |
|
The status of the process. S means sleeping, R means running, Z means zombie state, N means the priority value of the process is negative |
|
CPU usage occupied by the process |
|
Percentage of physical memory and total memory used by the process |
|
TIME+ |
The total CPU time occupied by the process after it is started, that is, the accumulated value of the CPU usage time. |
##COMMAND |
Process Start command name |
Input: free
##Total |
Total physical memory size.
|
||||||||||
##Used ##Already How big to use. |
|||||||||||
##Available how many. |
|||||||||||
More The total amount of memory shared by processes. |
##Buffers/cached |
||||||||||
The size of the disk cache. |
The third line (-/+ buffers/cached):
swap:
The difference between these two lies in the perspective of use. The first line is from the OS ( From the perspective of the operating system), because for the OS (operating system), buffers/cached are all used, so its available memory is 434884KB and the used memory is 3489800KB, The third line refers to the application perspective. For the application, buffers/cached is equal to available, because buffer/cached is to improve the performance of file reading. When the application When the program needs to use memory, buffer/cached will be recycled quickly. So from the perspective of the application, available memory = free +buffers+cached. As in the above example: 434884 + 36436 + 421856 = 893176 ##-/+ Calculation of the number of buffers/cache memory: -The number of memory in buffers/cache: used - buffers - cached The value of used: 3489800 - 36436 - 421856 = 3031508 +The number of memory in buffers/cache: free + buffers + cached The value of free: 434884 + 36436 + 421856 = 893176 |
The above is the detailed content of How to check memory usage in Linux?. For more information, please follow other related articles on the PHP Chinese website!