我的服务器的总内存与 USED + FREE 内存不匹配。我正在使用 linux 免费命令

My server's total memory doesn't match with USED + FREE memory. I'm using linux free command

我不太确定我的记忆发生了什么。我总共有31G内存,用的是1G,空闲的是9G

我的问题是,为什么,我只有9G,1G = 10G。与总内存31G相去甚远

我希望四处看看1G used and ~29G free。谁能帮忙解释一下?

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          31757        1264        9377         342       21114       29855
Swap:          2047           2        2044

$ free -g
              total        used        free      shared  buff/cache   available
Mem:             31           1           9           0          20          29
Swap:             1           0           1
buff/cache: 21114

您的操作系统将 "free" 内存用于 caching

来自维基百科:

Usually, all physical memory not directly allocated to applications is used by the operating system for the page cache. Since the memory would otherwise be idle and is easily reclaimed when applications request it, there is generally no associated performance penalty [...]