/proc/meminfo


/proc/meminfo  可以查看自己服务器 物理内存


注意这个文件显示的单位是kB而不是KB,1kB=1000B,但是实际上应该是KB,1KB=1024B


这个显示是不精确的,是一个已知的没有被更正的历史遗留问题。因为很多程序依赖这个文件查看内存使用的是kB字符


服务器物理内存总大小 MemTotal MemTotal是可使用内存的总量,单位是KB,物理内存减去一些保留内存和内核二进制代码占用的内存


MemFree 是服务器空闲内存,可用内存   MemFree 剩下没有被使用的物理内存,单位是kibibytes,即KB



 cat /proc/meminfo
MemTotal:       32869848 kB
MemFree:         2526688 kB
Buffers:          315540 kB
Cached:          2313660 kB
SwapCached:        12472 kB
Active:         26041716 kB
Inactive:        3295808 kB
Active(anon):   24943784 kB
Inactive(anon):  1765616 kB
Active(file):    1097932 kB
Inactive(file):  1530192 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194296 kB
SwapFree:        2069908 kB
Dirty:               868 kB
Writeback:             0 kB
AnonPages:      26695932 kB
Mapped:            67316 kB
Shmem:              1004 kB
Slab:             639372 kB
SReclaimable:     576880 kB
SUnreclaim:        62492 kB
KernelStack:        5280 kB
PageTables:       145288 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    20629220 kB
Committed_AS:   237472752 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      331056 kB
VmallocChunk:   34342004412 kB
HardwareCorrupted:     0 kB
AnonHugePages:  18964480 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        5632 kB
DirectMap2M:     2082816 kB
DirectMap1G:    31457280 kB