Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3625314
  • 博文数量: 880
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 6155
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-11 09:12
个人简介

To be a better coder

文章分类

全部博文(880)

文章存档

2022年(5)

2021年(60)

2020年(175)

2019年(207)

2018年(210)

2017年(142)

2016年(81)

分类: LINUX

2019-05-23 11:08:32


网上看到有相关错误,说是内存不够,但我的内存还有20G
[root@pdb06 log]# free -m
             total       used       free     shared    buffers     cached
Mem:         64386      64062        324          0        238      21831
-/+ buffers/cache:      41992      22394
Swap:       127999        991     127008

大虾们有什么建议?谢谢了
可能是内核BUG,buffer/cache的没有回收

临时解决方案是
sysctl -w vm.zone_reclaim_mode=1

这个参数告诉内核当内存不够用时就直接回收buffer/cache。

zone_reclaim_mode的定义kernel的文档里描述如下
Zone_reclaim_mode allows someone to set more or less aggressive approaches to
reclaim memory when a zone runs out of memory. If it is set to zero then no
zone reclaim occurs. Allocations will be satisfied from other zones / nodes
in the system.

This is value ORed together of

1 = Zone reclaim on
2 = Zone reclaim writes dirty pages out
4 = Zone reclaim swaps pages
我们用的方法通常是提高内存水线:(比如1G)
echo 1000000 > /proc/sys/vm/min_free_kbytes
另外,如果是suse的系统,还可以直接通过proc参数控制page cache的用量,其它系统应该没有合相关补丁。
阅读(1841) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~