Grails 2.0 PermGem Space with mileage

I have a main application that works great when I run it with grails run-app, and I want to run it with grails run-war. But I always get a known tomcat error java.lang.OutOfMemoryError: PermGem spaceon any request right after launch.

Well, I know that I need to change the value PermSize, so I tried all the methods that I found after googling ( JAVA_OPTS, GRAILS_OPTSand grails.tomcat.jvmArgs), and now I have the following script:

export JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
export GRAILS_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
grails -Dgrails.tomcat.jvmArgs="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m" run-war

but it doesn’t help. Still has java.lang.OutOfMemoryError: PermGen spaceon request.

What am I doing wrong? Is there any other way to configure PermSizefor Grails 2.0.1?

Update: I started ps -ef | grep javaand found that Grails really had my parameters, but then it started a new process, for tomcat, without parameters.

+3
source share
2 answers

It is established that it should be configured to BuildConfig.groovy:

grails.tomcat.jvmArgs= ["-Xms256m",  "-Xmx1024m", "-XX:PermSize=512m", "-XX:MaxPermSize=512m"]

Now it works fine.

+11
source

, grails.tomcat.jvmArgs, , , jvm-, 2 , JDK. jps , java ( grails ps, jinfo <PID> JVM- ( ). , , .

+1

All Articles