当前位置:网站首页>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最高)。
边栏推荐
- One click installation of highly available Nacos clusters in rainbow
- [quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
- Use of any superclass and generic extension function in kotlin
- opencv学习笔记一——读取图像的几种方法
- 单元测试报告成功率低
- Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
- Splunk查询csv lookup table数据动态查询
- Splunk query CSV lookup table data dynamic query
- 快速集成认证服务-HarmonyOS平台
- A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)
猜你喜欢
归并排序和非比较排序
Data type - integer (C language)
Implementation of navigation bar at the bottom of applet
Using helm to install rainbow in various kubernetes
Input of mathematical formula of obsidan
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
Analysis of maker education in innovative education system
rsync远程同步
2-3查找樹
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
随机推荐
Open3d ISS key points
Basic data types and string types are converted to each other
[Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering
[kuangbin]专题十五 数位DP
[IELTS speaking] Anna's oral learning records Part3
go写一个在一定时间内运行的程序
GFS分布式文件系统
Implementation method of data platform landing
Opencv learning note 3 - image smoothing / denoising
Full text query classification
BiSeNet的特點
Understanding of out covariance, in inversion and invariance in kotlin
The single value view in Splunk uses to replace numeric values with text
一种适用于应用频繁测试下快速查看Pod的日志的方法(grep awk xargs kuberctl)
Automatic upgrading of database structure in rainbow
单元测试报告成功率低
POJ - 3616 Milking Time(DP+LIS)
ES6_ Arrow function
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
国标GB28181协议视频平台EasyGBS新增拉流超时配置