当前位置:网站首页>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最高)。
边栏推荐
- Automatic upgrading of database structure in rainbow
- Understanding of out covariance, in inversion and invariance in kotlin
- iptables 之 state模块(ftp服务练习)
- [IELTS speaking] Anna's oral learning records part2
- go写一个在一定时间内运行的程序
- Snyk dependency security vulnerability scanning tool
- Analysis of maker education in innovative education system
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
- Pytoch (VI) -- model tuning tricks
- [kuangbin] topic 15 digit DP
猜你喜欢

opencv学习笔记三——图像平滑/去噪处理

Give full play to the wide practicality of maker education space

Exercise arrangement 2.10, 11

Opencv learning notes 1 -- several methods of reading images
![[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO](/img/56/82f4533b5bded73df222ef65101a72.png)
[quick start of Digital IC Verification] 10. Verilog RTL design must know FIFO
![[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)](/img/c2/32a2c1ede493b778a6c44077d765d0.png)
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)

DeiT学习笔记

PLSQL的安装和配置

Splunk query CSV lookup table data dynamic query
![[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning](/img/d8/ffc1b7527f0269cecb2946ab402a2e.png)
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
随机推荐
Ebpf cilium practice (1) - team based network isolation
Iptables' state module (FTP service exercise)
[kuangbin] topic 15 digit DP
单场带货涨粉10万,农村主播竟将男装卖爆单?
Explore creativity in steam art design
Use of out covariance and in inversion in kotlin
21 general principles of wiring in circuit board design_ Provided by Chengdu circuit board design
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
Low success rate of unit test report
Pytoch (VI) -- model tuning tricks
Go语言中,函数是一种类型
iptables 之 state模块(ftp服务练习)
[quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
Golang compilation constraint / conditional compilation (/ / +build < tags>)
POJ - 3616 Milking Time(DP+LIS)
Pvtv2--pyramid vision transformer V2 learning notes
ES6_ Arrow function
[Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering
Tips for using jeditabletable
opencv学习笔记三——图像平滑/去噪处理