当前位置:网站首页>redis故障处理 “Can‘t save in background: fork: Cannot allocate memory“
redis故障处理 “Can‘t save in background: fork: Cannot allocate memory“
2022-07-07 05:40:00 【IChen.】
1.解决方法
(1)编辑/etc/sysctl.conf添加
vm.overcommit_memory=1
(2)在/etc目录下执行sysctrl -p 使其生效
2.Linux内核参数overcommit_memory
它是 内存分配策略
可选值:0、1、2。
0, 表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
1, 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
2, 表示内核允许分配超过所有物理内存和交换空间总和的内存
3.什么是Overcommit和OOM
Linux对大部分申请内存的请求都回复"yes",以便能跑更多更大的程序。因为申请内存后,并不会马上使用内存。这种技术叫做 Overcommit。当linux发现内存不足时,会发生OOM killer(OOM=out-of-memory)。它会选择杀死一些进程(用户态进程,不是内核线程),以便释放内存。
当oom-killer发生时,linux会选择杀死哪些进程?选择进程的函数是oom_badness函数(在mm/oom_kill.c中),该 函数会计算每个进程的点数(0~1000)。点数越高,这个进程越有可能被杀死。每个进程的点数跟oom_score_adj有关,而且 oom_score_adj可以被设置(-1000最低,1000最高)。
边栏推荐
- [Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
- Virtual address space
- Transformation function map and flatmap in kotlin
- [hard core science popularization] working principle of dynamic loop monitoring system
- 基本数据类型和string类型互相转化
- POJ - 3784 running medium
- Full text query classification
- Implementation method of data platform landing
- Ebpf cilium practice (1) - team based network isolation
- [untitled]
猜你喜欢

Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu

Splunk查询csv lookup table数据动态查询

BiSeNet的特点

A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)

Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?

下载和安装orcale database11.2.0.4

The field value in Splunk subquery fuzzy matching CSV is*

GFS distributed file system

Splunk中single value视图使用将数值替换为文字

Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
随机推荐
[Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?
Splunk查询csv lookup table数据动态查询
AVL balanced binary search tree
GFS distributed file system
[paper reading] icml2020: can autonomous vehicles identify, recover from, and adapt to distribution shifts?
Using helm to install rainbow in various kubernetes
【Go ~ 0到1 】 第七天 获取时间戳,时间比较,时间格式转换,Sleep与定时器
Low success rate of unit test report
The field value in Splunk subquery fuzzy matching CSV is*
[kuangbin] topic 15 digit DP
GOLand idea intellij 无法输入汉字
Use of any superclass and generic extension function in kotlin
Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
2 - 3 arbre de recherche
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
The use of generics and vararg variable parameters in kotlin
Rsync remote synchronization
MES system is a necessary choice for enterprise production
A single game with goods increased by 100000, and the rural anchor sold men's clothes on top of the list?