How do I specify heap size configuration in a config file

微笑、不失礼 提交于 2019-12-21 06:16:13

问题


gem install fails with the following error, How do I specify the heap size configuration in a common place so that I don't have to re-define this every time.

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.

回答1:


This error and message are actually coming from jruby, not gem. Fortunately, jruby checks for default options in the JRUBY_OPTS environment variable.

So, try export JRUBY_OPTS=-J-Xmx1024m, and then, whenever you call gem install, jruby should automatically run with a 1024MB memory cap.



来源:https://stackoverflow.com/questions/6910429/how-do-i-specify-heap-size-configuration-in-a-config-file

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