Glassfish gem: allocating memory

Hi,

I’ve deployed redmine with the glassfish gem. Usage is light, so using
glassfish proper was overkill and ate a pile of memory. However, I’d
like improve the memory management - to jruby? - but don’t know how to
do this.

The current startup is simply:

glassfish -p 1234 -e production -n 2

Can anyone help, please?


Cheers,
Marc


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

marc wrote:

Can anyone help, please?

The biggest way to reduce memory would be to run with Rails 2.2 in
threadsafe mode, but I’m not sure redmine supports that yet.

You can try forcing the JVM max heap to be smaller using something like
this:

jruby -J-Xmx300M -S glassfish -p 1234 -e production -n 2

The -Xmx300M forces the JVM’s max heap to 300MB (the -J just passes it
through JRuby’s arg processing directly to the JVM). The default for
JRuby is 512MB…you may be able to choke it down a bit from that.

You might also want to look at the “jconsole” tool, which can connect to
running JVMs and give you memory information.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles Oliver N. said…

glassfish -p 1234 -e production -n 2

The -Xmx300M forces the JVM’s max heap to 300MB (the -J just passes it
through JRuby’s arg processing directly to the JVM). The default for
JRuby is 512MB…you may be able to choke it down a bit from that.

You might also want to look at the “jconsole” tool, which can connect to
running JVMs and give you memory information.

Thanks, Charlie. Useful instructions on managing the heap, and jconsole
is indeed very useful in this case. I’ll have to wait until tomorrow to
try it on the remote app, but locally, it looks like it’ll give me
everything I need to work with.


Cheers,
Marc


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email