Linux的"free -m":总计,已用和可用内存值不相加 [英] Linux "free -m": Total, used and free memory values don't add up

查看:649
本文介绍了Linux的"free -m":总计,已用和可用内存值不相加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux系统上,使用"free"时,以下值为:

On a linux system, while using "free", following are the values:

         total      used      free    shared  buff/cache   available
Mem:  26755612    873224    389320    286944    25493068    25311948
Swap:        0         0         0

总计,已使用和可用值不相加.我希望总数=已用+免费.

The total, used and free values don't add up. I'm expecting total = used + free.

问题: 我在这里想念什么?

Question: What am I missing here?

推荐答案

对于主内存,内存的实际大小可以计算为 used+free+buffers+cache used+free+buffers/cache ,因为 buffers/cache = buffer+cache .

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

free的手册页突出显示 used Used memory (calculated as total - free - buffers - cache)

The man page of free highlights used as Used memory (calculated as total - free - buffers - cache)

免费手册页上说:-

总安装内存(/proc/meminfo中的MemTotal和SwapTotal)

total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)

已使用 已用内存(按总-空闲-缓冲区-缓存计算)

used Used memory (calculated as total - free - buffers - cache)

免费 (未使用的内存(/proc/meminfo中的MemFree和SwapFree))

free Unused memory (MemFree and SwapFree in /proc/meminfo)

共享 (大部分)由tmpfs使用(/proc/meminfo中的Shmem, 在内核2.6.32上,如果不可用则显示为零

shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, on kernels 2.6.32, displayed as zero if not available)

缓冲区 内核缓冲区(/proc/meminfo中的缓冲区)使用的内存

buffers Memory used by kernel buffers (Buffers in /proc/meminfo)

缓存 /proc/meminfo)

cache Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)

buff/缓存 缓冲区和缓存之和

buff / cache Sum of buffers and cache

可用 :估计无需交换即可启动新应用程序的可用内存量.与由cache或free字段提供的数据不同,此字段将页面缓存考虑在内,并且由于正在使用的项目,并非所有可回收的内存slab都将被回收(/proc/meminfo中的MemAvailable,在3.14内核上可用,在内核2.6.27+,否则等于免费)

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)

就您而言,

873224(已用)+ 389320(免费)+ 25493068(buff/缓存)= 26755612(总计)

873224(used) + 389320(free) + 25493068(buff/cache) = 26755612(total)

这篇关于Linux的"free -m":总计,已用和可用内存值不相加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆