Forum: JRuby Glassfish gem: allocating memory

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
marc (Guest)
on 2009-02-10 17:11
(Received via mailing list)
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
Charles Oliver N. (Guest)
on 2009-02-11 04:00
(Received via mailing list)
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
marc (Guest)
on 2009-02-11 21:35
(Received via mailing list)
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
This topic is locked and can not be replied to.