tags:

views:

194

answers:

2

I've been running grails for sometime without any issues but recently after an upgrade to Grails 1.1.1, I've encountered the dreaded PermGen errors. Prior to the upgrade, no such issue.

The error seems to be happening when the <g:link> and <g:render> tags are used in a GSP although I'm not sure it's indicative that this is the issue but more of the fact that it ran out of space when these tags were being rendered.

Typically, everyone who encounters PermGen errors recommend increasing your java environment options -- but what maybe the source of the issue? Is it a Grails 1.1/hibernate/spring problem?

The error:

2010-04-20 05:37:03,962 INFO  [STDOUT] 05:37:03,961 ERROR [GroovyPagesServlet] Error processing GSP: 
Error executing tag <g:render>: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space 
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:render>: 
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space
+1  A: 

Large PermGen space requirements are a result of the automatic recompile feature that Grails offers in development mode. Having to increase PermGen space is a very, very small price to pay for on-the-fly recompiles. This issue does not arise in Grails production mode. The need for large PermGen is because Java stores class info in a portion of memory referred to as PermGen. This area of memory is completely distinct from heap and other portions of memory. (Increasing heap space does not increase PermGen size). When Grails recompiles a class it results in a new class being added to PermGen (rather than the existing class info being replaced). As you make more changes in devel mode, more and more PermGen memory is consumed.

A: 

Good explanation above.... try increasing it by

export JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m" 
bsreekanth