Monday, July 14, 2014

Eclipse Ggts and Grails memory settings

I started developing Groovy on Grails application in Eclipse Ggts. I experienced performance issues of Eclipse editor and application written in Groovy on Grails. Once I received following error:
java.lang.OutOfMemoryError: PermGen space

Following settings helped me to increase speed of Ggts and Grails app.

I adjusted settings of Ggts Eclipse ini file, i.e. I open:

and modified following argument to:

and modified following arguments:

and added following lines under list of arguments "-vmargs":

Then I adjusted Debug configuration (created before). I open dialog: 
Debug Configurations / Grails / MyProfile / Arguments

and put following settings to VM Arguments:
-server -Xms512m -Xmx2g -XX:PermSize=32m -XX:MaxPermSize=1g -Dfile.encoding=UTF-8 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC

(src: section Avoiding PermGen out of memory)

This simply increases memory consumption limit, so the Grails application will run smoother.

Other effective settings for VM Arguments:
-server -Xms128M -Xmx2G -XX:PermSize=128m -XX:MaxPermSize=1800m -Dfile.encoding=UTF-8 -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0 -XX:+UseTLAB -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSIncrementalMode -XX:-UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent

These settings can be applied to grails-app/conf/BuildConfig.groovy as well.

(src: section Using jvmArgs property)

Additional Tomcat notes ...

Grails - Apache Tomcat - JNDI DataSource settings, i.e. JDBC:
More at

Tomcat Admin user account settings: