Search code examples
javagrails

java.lang.OutOfMemoryError: Java heap space in grails


I am using grails to run https://github.com/Netflix/ice but I am just not able to get the server running, I get the following error:

| Error 2014-06-06 14:52:55,978 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: com.google.common.util.concurrent.ExecutionError: java.lang.OutOfMemoryError: Java heap space Message: com.google.common.util.concurrent.ExecutionError: java.lang.OutOfMemoryError: Java heap space Line | Method

I added this to my .bashrc file and it does not help:

export GRAILS_OPTS="-XX:MaxPermSize=1024m -Xmx1024M -server"

Solution

  • Why do you set the MaxPermSize to the same as the max heap size?

    Try:

    export GRAILS_OPTS="-Xms1g -Xmx1g -server"
    

    and let the JVM automatically set the perm size for you. If you find that is not sufficient, you can start tuning it.