I have a question about memory usage with JRuby. I am trying to get
JRuby (1.1.6RC1) to run in my GoDaddy virtual private server (Fedora
release 7 (Moonshine), with 256 guaranteed RAM). Its not so much that
I need this to happen, but I want it, and I also feel that it is
important for JRuby to be able to run on a wide range of platforms.
When I try to run it, I get this error message
[[email protected] ~]$ /opt/jruby-1.1.6RC1/bin/jruby -J-Xmn1m -J-Xms2m -
J-Xmx2m -e “puts ‘hello world’”
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Since that wasn’t working, I tried to examine the memory usage on my
macbook. I ran this:
nick-stielaus-computer-2:~ nick$ jruby -J-Xmn1m -J-Xms2m -J-Xmx2m
Warning: could not find JRE in /usr, using /System/Library/Frameworks/
JavaVM.framework/Versions/1.6.0/Home as JRE home.
and then looked at the output with “ps aux | grep jruby -B2”
nick 66901 0.0 1.0 335812 30900 ?? S Tue07PM
0:37.91 /Applications/TextMate.app/Contents/MacOS/TextMate -psn_0_548998
nick 16070 0.0 0.9 2874800 29308 s010 S+ 3:12PM
0:00.81 /usr/bin/java -client -Djruby.memory.max=2m -
Djruby.stack.max=1024k -Xmx2m -Xss1024k -Djna.boot.library.path=/opt/
jruby/lib/native/darwin -Xmn1m -Xms2m -Xbootclasspath/a:/opt/jruby/lib/
jruby.jar -classpath /opt/jruby/lib/bsf.jar:/opt/jruby/lib/jruby.jar:/
opt/jruby/lib/profile.jar: -Djruby.home=/opt/jruby -Djruby.lib=/opt/
jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh
My guess is that on the GoDaddy VPS jruby/java tries to use a ton of
virtual memory, even though that memory is not actually all accessible
to my VPS.
My questions are 1) Why does it appear that jruby is using 2.8 gigs of
virtual memory? 2) why is jruby using 29 megs of memory when I set
the -Xmx flag to 2 megs? 3) is there any way that I can limit the
virtual memory usage (ulimit ?) ?
Thanks for your help.
To unsubscribe from this list, please visit: