linux /proc/meminfo 计算used与free -k 差距大的问题排查---Slab内存占用及分析

本文介绍了Linux系统中/proc/meminfo计算内存使用与free命令显示差距大的原因,主要关注Slab内存分配器的作用。Slab用于小对象缓存,减少内存分配次数。当差距较大时,可通过/proc/slabinfo或slabtop检查Slab占用,并谨慎调整系统参数如drop_caches和min_free_kbytes。分析Slab占用可借助systemTap工具。
摘要由CSDN通过智能技术生成

当前我们系统(Centos7)内存占用率计算方式是由/proc/meminfo文件计算所得:memUsed = MemTotal - MemFree - Buffers- Cached

今天局点一个服务器产生告警,显示内存使用率已达到90%,free -k查看才30%左右,所以着手排查内存占用问题。

一、/proc/meminfo 计算used与free -k 差距大的原因

1、首先free命令的解释:

       free displays the total amount of free and used physical and swap
       memory in the system, as well as the buffers and caches used by the
       kernel. The information is gathered by parsing /proc/meminfo. The
       displayed columns are:

       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)

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

       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值