如何在配置文件中指定堆大小配置 [英] How do I specify heap size configuration in a config file
本文介绍了如何在配置文件中指定堆大小配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
gem install
会失败,并显示以下错误:如何在常见位置指定堆大小配置,以便我不必每次都重新定义。
错误:您的应用程序使用的内存超过了500m的安全上限。
指定-J-Xmx #### m来增加它(#### =大小以MB为单位)。
为完整的OutOfMemoryError堆栈跟踪指定-w。
解决方案
这个错误和消息实际上来自jruby,而不是宝石。幸运的是,jruby检查JRUBY_OPTS环境变量中的默认选项。所以,试试 export JRUBY_OPTS = -J-Xmx1024m
,然后,每当你调用 gem install
,jruby应该自动运行1024MB的内存容量。
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.
解决方案
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.
这篇关于如何在配置文件中指定堆大小配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文