当前位置:网站首页>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最高)。
边栏推荐
- Detailed explanation of apply, also, let, run functions and principle analysis of internal source code in kotlin
- 2 - 3 arbre de recherche
- The field value in Splunk subquery fuzzy matching CSV is*
- 使用SwinUnet训练自己的数据集
- Standard function let and generic extension function in kotlin
- MES系統,是企業生產的必要選擇
- Pytoch (VI) -- model tuning tricks
- opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
- 单场带货涨粉10万,农村主播竟将男装卖爆单?
- [machine learning] watermelon book data set_ data sharing
猜你喜欢
Famine cloud service management script
opencv学习笔记一——读取图像的几种方法
[quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
Opencv learning notes 1 -- several methods of reading images
【无标题】
Splunk子查询模糊匹配csv中字段值为*
Obsidan之数学公式的输入
Automatic upgrading of database structure in rainbow
Data type - integer (C language)
Wang Zijian: is the NFT of Tencent magic core worth buying?
随机推荐
[paper reading] icml2020: can autonomous vehicles identify, recover from, and adapt to distribution shifts?
iptables 之 state模块(ftp服务练习)
Learn how to compile basic components of rainbow from the source code
IP guard helps energy enterprises improve terminal anti disclosure measures to protect the security of confidential information
opencv学习笔记三——图像平滑/去噪处理
In go language, function is a type
Go write a program that runs within a certain period of time
2-3查找树
Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
Laravel8 uses passport login and JWT (generate token)
Rsync remote synchronization
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
Interpreting the practical application of maker thinking and mathematics curriculum
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
Opencv learning notes II - basic image operations
Xcit learning notes
基本数据类型和string类型互相转化
下载和安装orcale database11.2.0.4
Standard function let and generic extension function in kotlin
Openvscode cloud ide joins rainbow integrated development system