0
votes

Getting this error while starting grails with Tomcat

|Running Grails application
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error |
Forked Grails VM exited with error

I have GRAILS_OPTS set inside startGrails.bat

set GRAILS_OPTS=-server -Xmx2048M -Xms1024M -XX:PermSize=32m -XX:MaxPermSize=256m

I have CATALINA_OPTS set as an environment variable (since I am working with Tomcat server)

-server -Xms1024m -Xmx2048m -XX:MaxPermSize=256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Djava.net.preferIPv4Stack=true

I have also tried setting _JAVA_OPTIONS variable as

-Xmx2048M

I have also tried things like mentioning the VM sizes as arguments and changing the grails.project.fork values inside BuildConfig.groovy but no luck. Please help.

1

1 Answers

1
votes

Grails is a real memory hog.

After all the changes in the setting and variables, out of which nothing worked, I have decided to close all my application to free up RAM space (specially the Chrome tabs, which eats most of your RAM). Then I have started the grails application and it worked.