I am having issues with increasing the heap size for JRuby. The application is running Phusion Passenger and I installed JRuby using RVM.
I have tried
export JRUBY_OPTS="-J-Xmx1024m"
But it doesn't change the heap size. I tried
jruby -J-Xmx1024m
but it doesn't return and gets stuck.
I am not sure at this point how increase the limit. I am getting
gc overhead limit exceeded
quite frequently which stops the application. And the web application is super slow.
Also how to know if the Xmx
is set. I am doing ps aux | grep jruby
and getting below in return:
apache 11646 74.1 33.4 1861684 687864 ? Sl 14:00 29:24 /usr/bin/java -Djdk.home= -Djruby.home=/usr/local/rvm/rubies/jruby-1.7.16 -Djruby.script=jruby -Djruby.shell=/bin/sh -Djffi.boot.library.path=/usr/local/rvm/rubies/jruby-1.7.16/lib/jni:/usr/local/rvm/rubies/jruby-1.7.16/lib/jni/x86_64-Linux:/usr/local/rvm/rubies/jruby-1.7.16/lib/jni/i386-Linux:/usr/local/rvm/rubies/jruby-1.7.16/lib/jni/arm-Linux **-Xmx500m -Xss2048k** -Dsun.java.command=org.jruby.Main -cp -Xbootclasspath/a:/usr/local/rvm/rubies/jruby-1.7.16/lib/jruby.jar org/jruby/Main /usr/local/rvm/gems/ruby-1.9.3-p125/gems/passenger-4.0.41/helper-scripts/rack-loader.rb
Above command shows that jruby is using default Xmx
options.
Any help will be greatly appreciated.
If you're using Passenger under Apache, you should use SetEnv in your vhost to set the environment variables to use with the process. http://httpd.apache.org/docs/2.4/mod/mod_env.html
SetEnv JRUBY_OPTS -J-Xmx1024m