Let's take a look at the output of the free command:
[Root @ zfcg ~] # Free-m
Total used free shared buffers cached
Mem: 32101 15882 16219 0 459 13934
-/+ Buffers/cache: 1488 30613
Swap: 15999 0 15999
1. The first line of free output is from the operating system (OS.
There are a total of computers:
MB physical memory;
In these physical memory, Mb is used. For OS, buffers and cached are both used,
16219M is also available;
2. The second line of free output-/+ buffers/cache is from the application perspective,
The application considers that the system uses a total of 1488 M = 15882-459 M (buffers)-13934 M (cached)
And 30613M is available, = 16219 + 459 + 13934
For applications, buffers/cached is equivalent to available, because buffer/cached is used to improve file read performance. When the application needs to use the memory, buffer/cached will be recycled soon.
From the application perspective, the available memory = system free memory + buffers + cached
3. The current system memory usage is: (1-30613 M/32101) × 100% = 4.64%
4. buffer is used to store the data to be written into the disk, while cache stores the data read from the disk.