全部博文(108)
分类: 系统运维
2013-12-10 16:42:29
今天查看服务器的内存遇到一个问题,/proc/meminfo里显示是3.9G,但free -g只显示3G,free -m显示3.8G
[root@cdn nginx]# more /proc/meminfo
MemTotal: 3912240 kB
MemFree: 126712 kB
Buffers: 10092 kB
Cached: 255140 kB
SwapCached: 157752 kB
Active: 2714384 kB
Inactive: 922556 kB
Active(anon): 2554248 kB
Inactive(anon): 817792 kB
Active(file): 160136 kB
Inactive(file): 104764 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 6143992 kB
SwapFree: 5241636 kB
Dirty: 16852 kB
Writeback: 0 kB
AnonPages: 3361416 kB
Mapped: 12096 kB
Shmem: 456 kB
Slab: 64128 kB
SReclaimable: 27804 kB
SUnreclaim: 36324 kB
KernelStack: 2592 kB
PageTables: 12804 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 8100112 kB
Committed_AS: 3107612 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 283160 kB
VmallocChunk: 34359433744 kB
HardwareCorrupted: 0 kB
AnonHugePages: 1994752 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 6144 kB
DirectMap2M: 4179968 kB
[root@cdn nginx]# free -m
total used free shared buffers cached
Mem: 3820 3702 118 0 9 254
-/+ buffers/cache: 3437 382
Swap: 5999 881 5118
[root@cdn nginx]# free -g
total used free shared buffers cached
Mem: 3 3 0 0 0 0
-/+ buffers/cache: 3 0
Swap: 5 0 4
free -g的时候,为啥不能四舍五入呢?