free -k 输出 (RHEL 5 and RHEL 6):
total used free shared buffers cached
Mem: 7778104 2971960 4806144 0 211756 1071092
-/+ buffers/cache: 1689112 6088992
Swap: 4194296 0 4194296
free -k 输出 (RHEL 7/8):
total used free shared buff/cache available
Mem: 1012952 252740 158732 11108 601480 543584
Swap: 1048572 5380 1043192
/proc/meminfo相关值
MemTotal: 7778104 kB
MemFree: 4806144 kB
Buffers: 211756 kB
Cached: 1071092 kB
SwapTotal: 4194296 kB
SwapFree: 4194296 kB
MemAvailable: 543584 kB --RHEL 7/8 中新增的一个值,该值用来替换-/+ buffers/cache
free 输出 | 相应的/proc/meminfo值 |
---|---|
Mem: total | MemTotal |
Mem: used | MemTotal - MemFree |
Mem: free | MemFree |
Mem: shared (can be ignored nowadays. It has no meaning.) | N/A |
Mem: buffers | Buffers |
Mem: cached | Cached |
-/+ buffers/cache: used | MemTotal - (MemFree + Buffers + Cached) |
-/+ buffers/cache: free | MemFree + Buffers + Cached |
Swap: total | SwapTotal |
Swap: used | SwapTotal - SwapFree |
Swap: free | SwapFree |
7.1以后可参照下表:
free输出 | 相应的/proc/meminfo值 |
---|---|
Mem: total | MemTotal |
Mem: used | MemTotal - MemFree - Buffers - Cached - Slab |
Mem: free | MemFree |
Mem: shared | Shmem |
Mem: buff/cache | Buffers + Cached + Slab |
Mem:available | MemAvailable |
Swap: total | SwapTotal |
Swap: used | SwapTotal - SwapFree |
Swap: free | SwapFree |
参考:
https://access.redhat.com/solutions/406773