linux系统free命令返回如下请问是否正常??

为什么used+free比total少了几百兆?

第1个回答  2017-11-15
加上cache就对了...追问

完整命令怎么打?

追答

For the main memory, the actual size of memory can be calculated as used+free+buffers+cacheOR used+free+buffers/cache because buffers/cache = buffer+cache

total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used Used memory (calculated as total - free - buffers - cache)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, on kernels 2.6.32, displayed as zero if not available)
buffers Memory used by kernel buffers (Buffers in /proc/meminfo)
cache Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
buff / cache Sum of buffers and cache
available Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)
你命令没错,我是说加上后面的cache,used+free+buffers/cache =total

本回答被提问者采纳
相似回答