Home  >  Article  >  Operation and Maintenance  >  How to check memory in linux

How to check memory in linux

尚
Original
2019-12-26 10:00:348304browse

How to check memory in linux

Under Linux, we often use the top command to view system processes. Top can also display system memory. The special tool we commonly use to view content under Linux is the free command.

Detailed explanation of the free command to view memory under Linux:

To view memory under Linux, we generally use the free command:

$ free
total used free shared buffers cached
Mem: 3266180 3250004 16176 0 110652 2668236
-/ buffers/cache: 471116 2795064
Swap: 2048276 80160 1968116

The following is the memory Check the explanation of the output of the free command:

total: The total size of physical memory.

used: How big has been used.

free: How many are available.

Shared: The total amount of memory shared by multiple processes.

Buffers/cached: The size of the disk cache.

The third line (-/ buffers/cached):

used: How big has been used.

free: How many are available.

-/ buffers/cache meaning and difference:

The difference between used/free in the second line (mem) and used/free in the third line (-/ buffers/cache) lies in the used From a perspective:

The second line is from the perspective of the OS. Because for the OS, buffers/cached are all used, so its available memory is 16176KB and the used memory is 3250004KB, including , the kernel (OS) uses the buffers cached used by Application (X, oracle, etc).

The third line refers to the application point of view, for the application, buffers/cached is equal to Available, because buffer/cached is to improve the performance of file reading. When the application needs to use memory, buffer/cached will be recycled quickly.

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to check memory in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn