为什么 jruby 抱怨有效的 java_opts
我已将 java 最小/最大堆大小设置为与 Sun Docs 使用以下命令精确调整堆大小:
-Xms768m -Xmx768m
当我启动 tomcat 时,这工作正常,但如果我从命令运行 jruby
它抱怨道:
VM 初始化期间发生错误
指定的最小和最大堆大小不兼容
我在 jruby 文档 中阅读了有关某些 -JX 参数的信息但我需要显式地覆盖我的正常 jvm 设置,这似乎很愚蠢。
当我进行部署时,问题就出现了。我尝试在我的服务器上运行 jruby -S rake db:migrate ,但它抱怨。
运行 jruby 时我是否需要显式覆盖 JVM 设置?似乎任何 Xms/Xmx 值都会导致 jruby 抱怨。
更新 所以看起来一些设置确实有效。例如,所有这些都有效:
Xmx256m Xms256m
Xmx512m Xms256m
Xmx512m Xms500m
但这些无效:
Xmx512m Xms512m
Xmx512m Xms501m
Xmx768m Xms512m
I have set my java min/max heap size to be the same as outlined in the Sun Docs for precise heap sizing using the following:
-Xms768m -Xmx768m
This works fine when I start tomcat, but if I run jruby
from the command line it complains saying:
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
I read in the jruby docs about some -J-X params but it seems silly that I would need to explicitly override my normal jvm settings.
The problem arises when I do a deploy. I try running jruby -S rake db:migrate
on my server and it complains.
Is it true that I need to explicitly override my JVM settings when running jruby? It seems as though ANY Xms/Xmx values cause jruby to complain.
Update
So it seems that some settings do in fact work. For instance all of these work:
Xmx256m Xms256m
Xmx512m Xms256m
Xmx512m Xms500m
But these don't:
Xmx512m Xms512m
Xmx512m Xms501m
Xmx768m Xms512m
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎是 JRuby 的 shell 启动器的限制。好消息是本机 JRuby 启动器可以正确处理该问题,您可以通过以下方式安装它:
PS 如果您看到此类问题,请随时针对 JRuby 提交错误:http://bugs.jruby.org
This seems to be a limitation of JRuby's shell launcher. The good news that the native JRuby launcher handles that properly, you could install it via:
P.S. In case you see such problems, feel free to file bugs against JRuby: http://bugs.jruby.org