groovyvmargs

How to make groovy accept vm arg -Xss


I have ported some litle Java application to Groovy. The Java application needs to be started with the VM switches -server -Xss15500k to prevent a stackoverflow from happening. The question is how to pass these vm args on to groovy. I tried this here:

SET PATH=%PATH%;%GROOVY_HOME%\bin
groovy -server -Xss15500k MyApp.groovy

and this here:

SET PATH=%PATH%;%GROOVY_HOME%\bin
SET JAVA_OPTS=-server -Xss15500k
groovy MyApp.groovy

It both doesn't work and I get an OutOfmemoryError unlike the Java counterpart. Any hints how to get this done appreciated :-).

Thanks, Oliver


Solution

  • If you're getting an OutOfMemoryError then you probably want to increase the memory as well as the stack

    SET JAVA_OPTS=-server -Xss15500k -Xmx1G