答案1
简短的回答:“丢失”的内存被用于内核缓冲区和(大部分!)虚拟机/文件系统页面缓存。
这是一件好事。它使你的文件系统访问速度更快。
根据free
您的输出:
Total: 7.0G
used: 3.9G
free: 1.2G
shared: 11m
buf/cache: 1.9G
available: 2.9G
手册条目对free
这些列的解释如下:
total Total installed memory (MemTotal and SwapTotal in /proc/mem‐
info)
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)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cache Memory used by the page cache and slabs (Cached and SRe‐
claimable 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/mem‐
info, available on kernels 3.14, emulated on kernels 2.6.27+,
otherwise the same as free)
虽然内核缓冲区可能不容易回收,但如果有实际需求,内核会很乐意释放页面缓存并将内存提供给应用程序。显然目前没有需求。
总而言之,free
也就是说有 2.9G 可以立即使用,另外还有 1.9G...其中大部分可以随时释放。