zoukankan      html  css  js  c++  java
  • Linux Cannot allocate memory问题

    查找了一下相关文档,发现这个错误的含义其实就是像它自己说的,没法分配内存了。

    The problem is inherent with the way Java allocates memory when executing processes. When then exec(). Forking creates a child process by duplicating the current process. By duplicating the current process, the new child process will request approximately the same amount of memory as its parent process, essentially doubling the memory required. However, this does not mean all the memory allocated will be used, as exec() is immediately called to execute the different code within the child process, freeing up this memory. As an example, when Stash tries to locate git, the Stash JVM process must be forked, approximately doubling the memory required by Stash.

    解决方案:

    1. 编辑 /etc/sysctl.conf ,改vm.overcommit_memory=1,然后sysctl -p 使配置文件生效

      vi /etc/sysctl.conf

      修改/添加 vm.overcommit_memory=1

      Esc 退出  :wq 保存

      然后sysctl -p 使配置文件生效

  • 相关阅读:
    柳下品茗
    游百花诗意亭有感
    爱情如酒
    笑傲IT文坛
    面对诱惑,你会屈从吗?
    拓展人脉的三十六计
    世界经理人推荐:拓展人脉的两大法宝
    我还能做什么
    诗缘
    有谁陪我风雨同舟
  • 原文地址:https://www.cnblogs.com/zyulike/p/11490321.html
Copyright © 2011-2022 走看看