Recently I started getting PermGen space issue in my new jasper report application when tested under heavy load. I'm using groovy as expression evaluator for reports, by specifying language="groovy
in my jrxml file. As groovy expressions, create classes at runtime, I'm suspecting this to be the root cause for permgen filling up. I tried up setting up jvm options like -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled , but it did not help in solving the problem. Even in excpetion stacktrace (given below) also, classloader is trying to load the newly built class into permgen at the time of failure. Has anyone experienced this problem using groovy with jasper reports? My reports get filled asynchronously in a separate thread using capabalities provided by AsynchronousFillHandle
class provided by jasper. Does this have any connection towards the classloader not releasing the loaded runtime classes? Any suggestions would be greatly appreciated.
Exception in thread "Thread-563" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-565" at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.define(ClassLoaderForClassArtifacts.java:42)
at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:86)
at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:84)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:84)
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePogoMethod(CallSiteGenerator.java:215)
at org.codehaus.groovy.reflection.CachedMethod.createPogoMetaMethodSite(CachedMethod.java:220)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createCachedMethodSite(PogoMetaMethodSite.java:206)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createPogoMetaMethodSite(PogoMetaMethodSite.java:182)
at groovy.lang.MetaClassImpl.createPogoCallCurrentSite(MetaClassImpl.java:3034)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallCurrentSite(CallSiteArray.java:93)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at Section_1_1348126593121_343308.evaluate(calculator_Section_1_1348126593121_343308:253)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)
at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:884)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:421)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:406)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:257)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:457)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2037)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:771)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:301)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:148)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909)