JRuby Error: Your application used more memory than the safety cap of 500m

♀尐吖头ヾ 提交于 2019-12-20 06:28:11

问题


I was running a JRuby something.rb script and suddenly it throws this:

Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

What caused this and how do I fix it?


回答1:


You are running out of memory (heap) reserved for Java virtual machine. Try to increase it in server startup with command line parameters or configuration files.

Something like this:

server_start_command -J-Xm900m

Or fix your ruby script to use less heap memory.




回答2:


That would be -J-Xmx900m, which is basically just passing the -Xmx flag to the underlying JVM.




回答3:


you need to run like jruby -J-Xm900m abc.rb



来源:https://stackoverflow.com/questions/1758374/jruby-error-your-application-used-more-memory-than-the-safety-cap-of-500m

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!