Note that there are some explanatory texts on larger screens.

plurals
  1. PODebugging Heap Space Problems in Groovy/Grails Application using Quartz
    primarykey
    data
    text
    <p>I created a small application in Groovy/Grails that uses Quartz to execute a small job every 10 seconds. Now I have the problem that after several hours of running, the application crashes with a <code>org.quartz.JobExecutionException: java.lang.OutOfMemoryError: Java heap space [See nested exception: java.lang.OutOfMemoryError: Java heap space]</code>.</p> <p>Now I am trying to find the/one cause of that problem using the <a href="http://www.eclipse.org/mat/" rel="nofollow">Eclipse Memory Analyzer</a>. By finding "problem suspects", the analyzer shows this outcome:</p> <pre><code>Problem Suspect 1 3,926 instances of "groovy.lang.ExpandoMetaClass", loaded by "org.codehaus.groovy.grails.cli.support.GrailsRootLoader @ 0x122e88b98" occupy 95,746,168 (33.69%) bytes. Keywords org.codehaus.groovy.grails.cli.support.GrailsRootLoader @ 0x122e88b98 groovy.lang.ExpandoMetaClass -- Problem Suspect 2 1,010 instances of "com.mongodb.DBApiLayer", loaded by "org.codehaus.groovy.grails.cli.support.GrailsRootLoader @ 0x122e88b98" occupy 56,522,416 (19.89%) bytes. These instances are referenced from one instance of "org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[]", loaded by "org.codehaus.groovy.grails.cli.support.GrailsRootLoader @ 0x122e88b98" Keywords org.codehaus.groovy.grails.cli.support.GrailsRootLoader @ 0x122e88b98 org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[] com.mongodb.DBApiLayer </code></pre> <p>Is it normal to have that many instances of <code>ExpandoMetaClass</code> in a Groovy (and Grails) application or might that be a problem I introduced?</p> <p>Regarding MongoDB: The application reads and writes many small items from the DB using GORM <em>and</em> directly with Gmongo. However, I already checked all connections and they properly close after some time. The approximate number of live threads is about 40. So I think the DB layer should not be the problem. Still, it takes a large part of the heap. Any ideas on that?</p> <p>Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload