JRuby 1.1.2, Rails 2.1 Memory performance?

Running Red Hat Enterprise Server 4 on fairly powerful machine (quad
CPU’s etc etc) I have just setup JRuby + Rails.

I had a question about memory consumption and I was curious if it’s on
par with what should be expected or if I need to find a way to
optimize things a bit…

JRuby 1.1.2
JDK 1.6 64-Bit
Running a bare Rails 2.1 app

Memory Usage:
Total: 763MiB
RSS: 166MiB
Shared: 8.5MiB

I had around the same results using the Glassfish Gem as well.

Could anyone offer any insight on this? To the untrained eye it would
look like the Java process is consuming a ton of memory for a single
application.

Any thoughts?

Thanks!
-Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Matthew W. wrote:

Running Red Hat Enterprise Server 4 on fairly powerful machine (quad
CPU’s etc etc) I have just setup JRuby + Rails.

I had a question about memory consumption and I was curious if it’s on
par with what should be expected or if I need to find a way to
optimize things a bit…

JRuby 1.1.2
JDK 1.6 64-Bit
Running a bare Rails 2.1 app

64-bit tends to use more memory for one. But we also have continued to
improve memory utilization post 1.1.2…

Memory Usage:
Total: 763MiB
RSS: 166MiB
Shared: 8.5MiB

What’s the definition of Total and RSS there

I had around the same results using the Glassfish Gem as well.

Could anyone offer any insight on this? To the untrained eye it would
look like the Java process is consuming a ton of memory for a single
application.

Well, Rails is not small, and most deployment options launch multiple
Rails. Is your first example a single Rails app under JRuby, running
with something like Mongrel? If Total is actual memory used, that does
seem very high for even the fattest of applications. If RSS is total
memory used, it still seems high, but not unreasonable. Also, is this
immediately after startup or is there some execution involved in warming
the server up?

You could also try forcing less memory use to see if this is all
actually needed. JVM can sometimes be a little eager to grab more
memory. -J-Xmx###M for ### MB max.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Thu, Jul 3, 2008 at 11:41 AM, Charles Oliver N.
[email protected] wrote:

JDK 1.6 64-Bit
What’s the definition of Total and RSS there
This is what I’ve been trying to research… I’m pulling these from
the default System Monitor tool that ships with Red Hat… And it
appears all Java instances are consuming a ton of memory but in the
grand scheme of things, only around 1.2GB of 7GB of memory are being
consumed, which is much less that if you add up what the “Totals” are
from the monitor.

even the fattest of applications. If RSS is total memory used, it still
seems high, but not unreasonable. Also, is this immediately after startup or
is there some execution involved in warming the server up?

Yes, the first example is a single Rails App (2.1) under JRuby 1.1.2
running Mongrel 1.1.5. Development mode. Though I just ran it in
production mode and the numbers remain just about th same.

Server has been running for well over an hour and things are still
floating around those values, so it’s not necessarily startup or
warmup it seems.

You could also try forcing less memory use to see if this is all actually
needed. JVM can sometimes be a little eager to grab more memory. -J-Xmx###M
for ### MB max.

  • Charlie

Thanks for the response, I’m really enjoying the JRuby project and it
was a pleasure to get a chance to see you talk at Acts_as_conference
in Orlando a few months back and seeing all of the headway JRuby is
making. Bravo.

Is anyone else able to throw out some benchmarks on memory consumption
for a production server? I’m going to go ahead and fire up an
application I’ve got running on a Windows server (yuck) and see how it
performs.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Matthew,

Just a general comment, since I’ve seen lots of java-memory related
discussions in the past, and the main thing I got from those
discussions is that “don’t trust the memory monitors”, especially on
Windows, they show some numbers, but the numbers don’t mean much. :slight_smile:

Java does some advanced tricks to speed things up, and not all of them
“memory-monitor friendly”.

One better alternative would be to fire up jconsole and investigate
the memory graphs there, or to file memory profiler (e.g., that comes
with NetBeans - great and free one!), and see there.

Thanks,
–Vladimir

On Thu, Jul 3, 2008 at 7:13 PM, Matthew W.
[email protected] wrote:

Shared: 8.5MiB

seems high, but not unreasonable. Also, is this immediately after startup or

making. Bravo.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Matthew W. wrote:

JRuby 1.1.2

This is what I’ve been trying to research… I’m pulling these from
the default System Monitor tool that ships with Red Hat… And it
appears all Java instances are consuming a ton of memory but in the
grand scheme of things, only around 1.2GB of 7GB of memory are being
consumed, which is much less that if you add up what the “Totals” are
from the monitor.

Ok, then the Total size is really the virtual size…the space that the
JVM has “expressed an interest in” but has not actually used yet. I
believe virtual size for most processes is typically far larger than
what they’re actually consuming. In this case, it’s probably that large
because JRuby sets the “max heap size” to around 512MB by default, and
JVM itself probably adds on a bunch of extra for 64 bit and for JVM
internal memory use. So RSS: is probably your actual “commit size”.
Again, still large, but much more reasonably than the “Total” size.

Yes, the first example is a single Rails App (2.1) under JRuby 1.1.2
running Mongrel 1.1.5. Development mode. Though I just ran it in
production mode and the numbers remain just about th same.

Server has been running for well over an hour and things are still
floating around those values, so it’s not necessarily startup or
warmup it seems.

Is it possible to run under MRI to see if it’s a case where we’re
consuming considerably more than we should?

You could also try forcing less memory use to see if this is all actually
needed. JVM can sometimes be a little eager to grab more memory. -J-Xmx###M
for ### MB max.

This probably won’t make a difference since it appear your actual “in
use” size is far below the default 512MB setting. You could try someting
like 128MB but it probably wouldn’t even be able to start up.

Thanks for the response, I’m really enjoying the JRuby project and it
was a pleasure to get a chance to see you talk at Acts_as_conference
in Orlando a few months back and seeing all of the headway JRuby is
making. Bravo.

Is anyone else able to throw out some benchmarks on memory consumption
for a production server? I’m going to go ahead and fire up an
application I’ve got running on a Windows server (yuck) and see how it
performs.

I don’t, but I’m sure there are others around who have some metrics for
you.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Thu, Jul 3, 2008 at 1:47 PM, Charles Oliver N.
[email protected] wrote:

I had a question about memory consumption and I was curious if it’s on
Memory Usage:
consumed, which is much less that if you add up what the “Totals” are

Yes, the first example is a single Rails App (2.1) under JRuby 1.1.2
running Mongrel 1.1.5. Development mode. Though I just ran it in
production mode and the numbers remain just about th same.

Server has been running for well over an hour and things are still
floating around those values, so it’s not necessarily startup or
warmup it seems.

Is it possible to run under MRI to see if it’s a case where we’re consuming
considerably more than we should?

That’s the next plan of action… I’m in a pretty locked down
situation (which is why I’m running JRuby to begin with) so it could
be a while before I have MRI available to test. My Mongrel instances
on a Windows box running MRI are consuming around 60mb RAM each.

Thanks for the response, I’m really enjoying the JRuby project and it

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Matt,
Try doing a heap dump and use a memory analyzer to see what’s taking
up so much memory. I personally use the jconsole and invoke the dumpHeap
operation on the JVM, then use YourKit to analyze the dump file. It’s a
bit of
a pain to traverse all the JRuby internal structure, but it may give you
some
idea about what’s taking up so much RAM.

If you find any interesting memory hog, do report back. Personally, I
am very interested in reducing the footprint of my JRuby app also.

Peter

On Thu, Jul 3, 2008 at 1:56 PM, Matthew W.
[email protected] wrote:

CPU’s etc etc) I have just setup JRuby + Rails.
improve memory utilization post 1.1.2…

Memory Usage:
Total: 763MiB
RSS: 166MiB
Shared: 8.5MiB

Just a quick follow-up. I loaded up the latest MRI (stable) on the
same machine and a single Mongrel instance showed the following:

Total: 81.2MiB
RSS: 48.8MiB
Shared: 2.5MiB

CPU utilization on any given activity seemed a little less as well.

And of course this is in no way putting down the JRuby project, I’m
just trying to best gather information for a possible deployment of
many future applications on this server and weighing our options. We
may be running an existing app server such as Tomcat to begin with so
packaging up my Rails applications and benchmarking them there is
going to be an option as well.

has “expressed an interest in” but has not actually used yet. I believe

on a Windows box running MRI are consuming around 60mb RAM each.

I don’t, but I’m sure there are others around who have some metrics for you.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs