Out of memory: Kill process 內存不足


 

服務直接被 killed,感覺特別奇怪。代碼肯定是沒有問題的,但為什么放到服務器上就出錯了呢。 

部署時報錯如下:

Shell代碼   收藏代碼
  1. Failed to add the deployment content to the repository: java.util.concurrent.CancellationException: Operation was cancelled  


wildfly 報錯如下:

Shell代碼   收藏代碼
  1. ./standalone.sh: line 307: 12526 Killed   


一時還真看不出是什么毛病。 

於是使用 dmesg 查找原因,終於找到了原因: 

Shell代碼   收藏代碼
  1. # dmesg | tail  
  2. [1147898.706546] Out of memory: Kill process 12526 (java) score 399 or sacrifice child  
  3. [1147898.710393] Killed process 12526 (java) total-vm:2559448kB, anon-rss:403304kB, file-rss:780kB, shmem-rss:0kB  
  4. [1147898.738479] oom_reaper: reaped process 12526 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB  


原來是因為內存不足導致了。我使用的服務器內存只有 1G,上面跑了很多的服務,因此可以內存並不大,所以才出了問題。 


免責聲明!

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



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