I’ve an basic app that working fine when i’m runngin it with grails run-app, and I want to run it using grails run-war. But i’m always getting famous tomcat’s java.lang.OutOfMemoryError: PermGem space error, on any request, just after start.
Well, I know that I need to change PermSize value, so I tried all ways that i’ve found after googling (JAVA_OPTS, GRAILS_OPTS and grails.tomcat.jvmArgs), and now I have 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 having java.lang.OutOfMemoryError: PermGen space on first request.
What i’m doing wrong? Is there any other way to configure PermSize for Grails 2.0.1?
Update: I run ps -ef | grep java and found that Grails actually got my params, but then it ran a new process, for tomcat, w/o this params.
Found that it must be configured at
BuildConfig.groovy:Now it’s working fine.