centos out of memory




1) Configuring OOM killer: The values in overcommit_memory mean

0-Heuristic memory overcommit (default setting)

1-Always overcommit

2-Disable overcommit

When overcommit_memory is set to 2 ,the total address space commit for the system is not permitted to exceed swap + configurable percentage (default is 50) of physical RAM. The default value can be changed to 75 using

echo "75">/proc/sys/vm/overcommit_ratio.

However if your trying to tune the killer for a particular process you can write any value between -16 to +15 the higher value means that process is more likely to be the victim of OOM killer to/proc/pid/oom_adj. Values -17 exempts process from OOM killer.

The value /proc/pid/oom_score is the badness score the higher the score more likely the process will be victim.

2) Disabling OOM killer

You can completely disable the OOM killer using

`sysctl vm.overcommit_memory=2`

`echo "vm.overcommit_memory=2" >> /etc/sysctl.conf`



There are several files under /proc/sys/vm/ directory: overcommit_memory, overcommit_ratio;

If you want to limit the max memory used process to 75%, you can try following commands:

echo 2 > /proc/sys/vm/overcommit_memory echo 75 > /proc/sys/vm/overcommit_ratio

If you want to disable the OOM killer, you can try following command:

echo 1 > /proc/sys/vm/overcommit_memory

The OOM killer is part of Linux Kernel, so it is running in kernel space.





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值