Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of viewing memory information in linux

Shulou Source: shulou.com Published: 2022-06-03 03:34:13 10月04日 Update

Under Linux, we often use the top command to view the system process, and top can also display the system memory. Our common tool for viewing content under Linux is the free command.

Memory View Command free under Linux:

To view memory under Linux, we usually 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 an explanation for viewing the output of the free command in memory:

Total: the total amount of physical memory.

Used: how much has been used.

Free: how many are available?

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

Buffers/cached: size of the disk cache.

The third line (- / + buffers/cached):

Used: how much has been used.

Free: how many are available?

-/ + buffers/cache meaning and difference:

The difference between the used/free of the second line (mem) and the third line (- / + buffers/cache) used/free is from the perspective of usage:

The second line is from the point of view of OS, because OS,buffers/cached belongs to being used, so his available memory is 16176KB, and the used memory is 3250004KB, including + buffers+cached used by + Application (X, oracle,etc) for OS.

The third line refers to that from an application point of view, buffers/cached is equal to available for applications, because buffer/cached is designed to improve file read performance, and buffer/cached is quickly recycled when the application needs to use memory.

These are the details of how linux views memory. Please pay attention to other related articles for more information.

Tags: Memory command content application program angle three lines application size commonly used system process special tools including kernel meaning multiple internal that is tools Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux OPPO Reno Huawei vpn NVidia