OutOfMemoryError

I’m having an OutOfMemory problem. We’re running a rails 2.0.1 app on
jruby 1.1.1 with MSSQL 2005 via ar-jdbc 0.7.2. The server is a linux
machine running WebSphere 6.1, and goldspike 1.6.1 is the glue between
rails and websphere. We’re using WebSphere’s SQL Server JDBC adapter. I
don’t know what WebSphere’s max heap is set to.

The java stack trace is different every time, and the specific symptoms
vary a bit, but the common component of each server crash is an
OutOfMemoryError and the complete unavailability of our application
until
the server is restarted. The latest crash (and the first one in our
staging environment) happened after about 4 hours of uptime and heavy
usage by a system test team. And, of course, this happened less than 1/2
hour after I explained to the customer and my manager why this wouldn’t
be
a problem. :stuck_out_tongue:

Obvious things that jump to mind:

  • increase -Xmx
  • check for heavy session usage (some on the dev team tend to dump too
    much into the session) – is there a way to tell Rails or the servlet
    context that a session can be emptied?

From watching this list, it has sounded like there aren’t significant
memory leak-type problems in JRuby, and (my inference is) that everyone
else has long-running server processes that aren’t having memory issues,
especially with JRuby 1.1+. Are there any known leaks (and hopefully
workarounds) in JRuby? I found a fairly recent bug report [1] that
implies
that AR transactions in JRuby leak memory.

In short, has anyone else seen OutOfMemoryErrors with JRuby & Rails? Are
there good tools or techniques for diagnosing the problem?

Thanks,
Matt

[1] http://jira.codehaus.org/browse/JRUBY-2208


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Matt,
first add
-XX:+PrintGCDetails
(same place where -Xmx)
Then read carrefuly:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
this will give You really good overview of the situation.

Best greetings,
Pawe³ Wielgus

Also, make sure to rule out that the error is not referring to
PermGen space. There is usually a different error message for PermGen
space, but I recall older JVM versions didn’t make the distinction.

-XX:MaxPermSize=256m

-lenny

On May 9, 2008, at 3:00 AM, Paweł Wielgus wrote:

symptoms
a problem. :stuck_out_tongue:
significant
Rails? Are
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

You can configure the JVM to generate a heap dump on OOM and then use
a tool like SAP’s memory analyzer to see where your leak is at.
Generally, if its an application problem you’ll find an inordinate
number of instances of the same type of object that obviously
shouldn’t be there.

Here is how you turn on the dump, add this to JAVA_OPTS:
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heaps

beware that this file can be very large and it will create a new file
every time the JVM dies.

Here is a link for the SAP tool:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/Java/Java+Memory+Analysis&

good luck!

-Tyler J.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Yes, do make sure whether it’s permgen or normal heap memory. Large
Rails apps running with many runtimes for a long time can still
occasionally blow the default permgen maximum, which is set rather low.

Lenny M. wrote:

Hi Matt,
On 09/05/2008, [email protected] [email protected] wrote:

the server is restarted. The latest crash (and the first one in our
much into the session) – is there a way to tell Rails or the servlet


http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On May 9, 2008, at 10:44 AM, Lenny M. wrote:

Also, make sure to rule out that the error is not referring to
PermGen space.

Uhmm…I meant make sure its not referring to PermGen space. :slight_smile:

first add

I’m having an OutOfMemory problem. We’re running a rails 2.0.1
symptoms
a problem. :stuck_out_tongue:
significant
In short, has anyone else seen OutOfMemoryErrors with JRuby &

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

It doesn’t look like a permgen issue. I’m not sure what our max is right
now, but the log files don’t have the error messages that IBM says they
would have if permgen ran out.

Charles Oliver N. wrote:

this will give You really good overview of the situation.

don’t know what WebSphere’s max heap is set to.
hour after I explained to the customer and my manager why this
From watching this list, it has sounded like there aren’t significant
Rails? Are


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,
Using the SAP Memory Analyzer should be easy.
By the was it is now open source : http://www.eclipse.org/mat/
I can help you out, in case you have problems with the tool.

Regards,
Markus

maburke wrote:

Matt

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heaps

http://xircles.codehaus.org/manage_email


View this message in context:
http://www.nabble.com/OutOfMemoryError-tp17140327p17202659.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for the link. I’ll try it out. I tried out one of IBM’s heap
analyzers, and didn’t get very far with it. Hopefully SAP’s will be
easier to use.

We’re cautiously optimistic that the system just got set up with the
default max heap size (256MB iirc) which is way too low. Hopefully I’ll
be able to confirm that with SAP’s memory analyzer.


Matt

Tyler J. wrote:

every time the JVM dies.

http://xircles.codehaus.org/manage_email

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