The free command displays system usage and idle memory conditions, including physical memory, interactive area memory (swap), and kernel buffer memory
Parameters
-B Display memory in bytes
-K display memory in kilobytes
-m display memory in units of M.
-O Ignore Buffer throttling columns
-T sum information
-s< time > Execute command every specified time in s
-h displays capacity in readable form and requires free-v display version greater than 3.3
-V Version Information
Example
Example 1
[Email Protected]:/home/tnak # free-s 3 #每3秒执行一次
[Email Protected]:/home/tnak # free-m #以M为单位
[Email protected]:/home/tnak<u><font color= "#0066cc" > </font></u># free-k #以K为单位
Example 2free-h #以可读形式显示容量, requires procps-ng version greater than 3.3
$ free-h
PS: Return information description
Mem: Indicates physical memory statistics
-/+ buffers/cached: Cache statistics representing physical memory
Swap: Indicates the usage of the swap partition on the hard disk,
Line 1th Mem:
Total: Indicates the amount of physical memory.
Used: Represents the amount that the total is allocated to the cache (including buffers and cache), but may not be actually used in some of the caches.
Free: Memory that has not been allocated.
GKFX: Shared memory, general system will not be used, nor discussed here.
Buffers: The number of buffers that are allocated but not used by the system.
Cached: The number of caches that the system allocates but has not been used.
Total = used + Free
Line 2nd-/+ buffers/cached:
Used: The used-buffers-cached in the first row is also the amount of memory actually used.
Free: The sum of unused buffers and cached and unallocated memory, which is the actual memory =free+buffers+cached currently available on the system.
Because buffers and cached are the amount of memory the system needs to improve the performance request, it is actually possible to use the memory when the application requires this functionality, so it is also available to the application.
The third line is for the interchange control, which shows the usage (used) and how many free swap areas are available.
Basic usage of free memory space in Linux