Jruby - OutOfMemory java heap space whilst running under tomcat 6

We are running a ruby on rails app under jruby in a tomcat 6 container,
after 4
weeks of uptime we have run encountered an
OutOfMemoryError java heap space.

SEVERE: Exception invoking periodic operation:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.lang.StringCoding.safeTrim(StringCoding.java:64)
at java.lang.StringCoding.access$300(StringCoding.java:34)
at
java.lang.StringCoding$StringEncoder.encode(StringCoding.java:251)
at java.lang.StringCoding.encode(StringCoding.java:272)
at java.lang.String.getBytes(String.java:946)
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at
java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:228)
at java.io.File.exists(File.java:733)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1113)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.ja
va:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337
)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChild
ren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChild
ren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(Containe
rBase.java:1590)
at java.lang.Thread.run(Thread.java:662)

After examining the heap dump we have discovered that around 600
megabytes of
heap was consumed as below :
org.quartz.simpl.SimpleThreadPool$WorkerThread
-> org.joni.ByteCodeMachine
–> org.joni.StackEntry | Shallow Heap = 67,108,880 | Retained Heap =
593,721,520

My thoughts are that our quartz scheduler starts a jruby runtime each
time its
invoked that isn’t being cleaned up.

Just wanted to know what the StackEntry class (Is it a Jruby runtime)
and
why it isn’t being cleaned up …

OOM ! Maybe u should dump the heap by jmap

在 Fri, 09 Sep 2011 14:10:51 +0800,Andrew McNamara
[email protected] 写道:

    at java.lang.StringCoding.access$300(StringCoding.java:34)
    at

org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChild
megabytes of
why it isn’t being cleaned up …


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


李福(李建业)

淘宝-技术研发部-广告技术
TEL:0571-88155188-79604
Email:[email protected]

This email (including any attachments) is confidential and may be
legally privileged. If you received this email in error, please delete
it immediately and do not copy it or use it for any purpose or disclose
its contents to any other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。