zoukankan      html  css  js  c++  java
  • redis启动之WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the comm

    WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    警告超委托内存设置为0!后台保存可能在低内存条件下失败。若要修复此问题,将“VM OpRebug内存=1”添加到/ETC/SysTL.CONF中,然后重新启动或运行命令“SysTtl VM.OpjExtRebug内存=1”,以使其生效。

    解决办法:

    执行

    echo 1 > /proc/sys/vm/overcommit_memory

    这个命令进行配置

    但是为什么这么设置呢。我来解释一下参数:

    0, 表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。1, 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。2, 表示内核允许分配超过所有物理内存和交换空间总和的内存

  • 相关阅读:
    文件读写
    使用HttpClient实现文件的上传下载
    TreeMap
    Linux的目录结构与文件权限
    Hibernate中get()和load()方法的区别
    Hibernate中openSession()与getCurrentSession()的区别与联系
    Hibernate核心类和接口
    Hibernate连接数据库
    Struts2中OGNL表达式的用法
    Struts2中Result的配置
  • 原文地址:https://www.cnblogs.com/mclzy/p/9088391.html
Copyright © 2011-2022 走看看