free コマンド出力内容と/proc/meminfo の関係

estis2018/11/08 (木) 23:47 に投稿

https://access.redhat.com/solutions/406773

RedHat 7.1 からは、
Mem:available
という項目ができた。

Mem: used
も意味が異なる。
MemTotal - MemFree
だったのが、
MemTotal - MemFree - Buffers - Cached - Slab
になった。

CentOS での例

# cat /etc/centos-release 
CentOS Linux release 7.0.1406 (Core) 
# free -k; cat /proc/meminfo
             total       used       free     shared    buffers     cached
Mem:       2097152    2097152          0     108840          0    1963560
-/+ buffers/cache:     133592    1963560
Swap:      4194304     108280    4086024
MemTotal:        2097152 kB
MemFree:               0 kB
Cached:          2072420 kB
Buffers:               0 kB
Active:            21840 kB
Inactive:        2055384 kB
Active(anon):       2572 kB
Inactive(anon):     2232 kB
Active(file):      19268 kB
Inactive(file):  2053152 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194304 kB
SwapFree:        4086024 kB
Dirty:                28 kB
Writeback:             0 kB
AnonPages:          4804 kB
Shmem:            108840 kB
Slab:              12744 kB
SReclaimable:       9416 kB
SUnreclaim:         3328 kB

 

# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
# free -k; cat /proc/meminfo 
              total        used        free      shared  buff/cache   available
Mem:        2914636      972232      746276       91696     1196128     1597004
Swap:             0           0           0
MemTotal:        2914636 kB
MemFree:          746376 kB
MemAvailable:    1597104 kB
Buffers:               0 kB
Cached:           936612 kB
SwapCached:            0 kB
Active:          1352316 kB
Inactive:         475708 kB
Active(anon):     953020 kB
Inactive(anon):    30088 kB
Active(file):     399296 kB
Inactive(file):   445620 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:        891340 kB
Mapped:            62024 kB
Shmem:             91696 kB
Slab:             259516 kB
SReclaimable:     197320 kB
SUnreclaim:        62196 kB
KernelStack:        2848 kB
PageTables:         7452 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1457316 kB
Committed_AS:    2422812 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       15248 kB
VmallocChunk:   34359715580 kB
HardwareCorrupted:     0 kB
AnonHugePages:    720896 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       75632 kB
DirectMap2M:     2021376 kB
DirectMap1G:     1048576 kB