Free is used to display system memory usage and has been confusing the output of the, which is summarized as follows:
123 4 5 6
The output of the free command comes from the file/proc/meminfo, which is displayed by default in kilobytes, and can be displayed in megabytes with the-m option, dividing the output into 4 rows and 3 columns for convenience, fo[1][1] represents the first row of the first column of the output, or total. The following are explanations of the columns in each row:
FO[2][1]: Indicates that the system considers that there is currently a total of 24676104KB memory.
FO[2][2]: Indicates that the system considers that 17659596KB of memory is currently in use.
FO[2][3]: Indicates that the system believes that there is currently 7016508KB of memory available.
FO[2][4]: Obsolete, ignored.
FO[2][5]: Represents memory that is allocated by the system as buffers, but has not yet been used.
FO[2][6]: Represents the memory that is allocated by the system as the cache, but not yet used.
- A buffer is something that have yet to being "written" to disk.
- A cache is something that have been "read" from the disk and stored for later use.
That is, buffer is used to store the data to be output to disk (block device), and the cache is to store the data read from disk. Both are designed to improve IO performance and are managed by the OS
That is, the data in this line of MEM shows how the memory is being used from a system point of view.
FO[3][2]: The memory the application has actually used.
FO[3][3]: The memory that the application can also use.
That is:-/+ Buffers/cache This line of data shows how memory is used from an application perspective.
Three equations can be summed up from the above explanations:
FO[2][1] = fo[2][2]+fo[2][3]
FO[3][2] = fo[2][2]-fo[2][5]-fo[2][6]
FO[3][3] = fo[2][3]+fo[2][5]+fo[2][6]
Linux Performance monitoring free