简体   繁体   中英

Why does jruby complain about valid java_opts

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 -JX 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

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:

jruby -S gem install jruby-launcher

PS In case you see such problems, feel free to file bugs against JRuby: http://bugs.jruby.org

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM