当前位置:网站首页>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最高)。
边栏推荐
- Use of out covariance and in inversion in kotlin
- Exercise arrangement 2.10, 11
- Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?
- Deit learning notes
- POJ - 3616 Milking Time(DP+LIS)
- Splunk查询csv lookup table数据动态查询
- Give full play to the wide practicality of maker education space
- 字符串操作
- Grpc, oauth2, OpenSSL, two-way authentication, one-way authentication and other column directories
- POJ - 3784 running medium
猜你喜欢
Componentspace2022, assertions, protocols, bindings, and configuration files
Practice of combining rook CEPH and rainbow, a cloud native storage solution
Train your dataset with swinunet
Open3D ISS关键点
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
Opencv learning note 4 - expansion / corrosion / open operation / close operation
Using nocalhost to develop microservice application on rainbow
Give full play to the wide practicality of maker education space
Improve the delivery efficiency of enterprise products (1) -- one click installation and upgrade of enterprise applications
Splunk query CSV lookup table data dynamic query
随机推荐
[hard core science popularization] working principle of dynamic loop monitoring system
使用BiSeNet实现自己的数据集
Tips for using jeditabletable
Exercise arrangement 2.10, 11
Data type - integer (C language)
MES system is a necessary choice for enterprise production
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
opencv学习笔记五——梯度计算/边缘检测
Open3D ISS关键点
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
Merge sort and non comparison sort
Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
Opencv learning note 5 - gradient calculation / edge detection
How to understand distributed architecture and micro service architecture
Through the "last mile" of legal services for the masses, fangzheng Puhua labor and personnel law self-service consulting service platform has been frequently "praised"
[go ~ 0 to 1] obtain timestamp, time comparison, time format conversion, sleep and timer on the seventh day
AVL balanced binary search tree
GOLand idea intellij 无法输入汉字
One click deployment of highly available emqx clusters in rainbow
[Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering