Search code examples
grailsjvm-arguments

How to set JVM stack size in Grails BuildConfig


I have a Grails 2.3.X project which fails to compile unless given more stack size with -Xss1024k command line argument. At the moment this works fine, but requires me to export/set the JVM option each time I build the project for the first time. Also, developers starting out freshly in the project will stumble on this always, so I'd like it to be part of the code checked out of version control.

Is there a way to set stacksize(-Xss) JVM option in Grails 2.3.X BuildConfig?

P.S. The -Xss JVM option is one of the less documented ones. I found it only through internet archives linked here in StackOverflow


Solution

  • Since you are using Grails 2.3 you can use forked execution. In your case you can pass the additional arguments as such:

    grails.project.fork.compile.jvmArgs = [ '-Xss1024k' ]