---restore content starts---
The free command shows the usage statistics for the physical memory and swap partitions in the Linux system.
Available memory = Free + buffers + Cached
First behavior physical memory usage statistics:
| Title |
Description |
| Total |
Total Physical Memory Total=used+free |
| Used |
Amount of memory used, including reference usage +buffer+cached |
| Free |
Total Free Memory |
| Shared |
Total Shared memory |
| Buffers |
Cache consumed by block devices |
| Cached |
Cache for normal file data consumption |
| Available |
Current total available memory, without virtual memory |
In the second row-/+ Buffers/cache only two columns used and free have values, which are the adjustment values of the physical memory
| Title |
Description |
| Used |
Memory used (used) minus buffer and cached, that is, the total amount of memory that the app is using |
| Free |
Free memory plus buffer and cached memory, which is the total amount of available memory |
Third act Exchange partition usage statistics
| Title |
Description |
| Total |
Total Swap partition memory |
| Used |
Swap partition memory in use |
| Free |
Idle swap partition memory |
In the above indicators, we need to note that under these circumstances, the system is normal, do not need to worry about
Idle memory free close to 0
0 using memory used close to total
Available memory (Free+buffers/cache) accounted for more than 20% of total
Swap partition memory swap has not changed
The following situation indicates that the memory is too low, need attention!
Available memory (Free+buffers/cache) is too low, close to 0
Swap partition memory consumption swap used increased or fluctuating
DMESG | grep Oom-killer shows a outofmemory-killer is running
Common parameters
-b/k/m/g display results in bytes/kilobytes/megabytes/gigabytes units
-H output statistical results in a human-readable manner
-T use this option to display more than one row of statistics that is titled Total
-O Suppress buffer adjustment values for the second row
-S automatically refreshes results every few seconds
-C with-s used to control the number of refresh results
-L display statistical details of high and low memory
-A shows available memory
-V Show version number
Linux calculates real available memory