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 使配置文件生效

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM