Question

I have an application developed by another programmer that I have to run with grails 2.3.8 locally on my PC, so I installed grails through gvm, I installed ggts and I imported my program, but at compile time I get the following error:

Fatal Error during compilation org.apache.tools.ant.BuildException: java.lang.OutOfMemoryError: Java heap space (Use - stacktrace to see the full trace) 

My computer has 8gb of ram and I tried to change the filter GGTS.ini as follows:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140116-2212
-product
org.springsource.ggts.ide
--launcher.defaultAction
openFile
-vmargs
-Dgrails.console.enable.interactive=false
-Dgrails.console.enable.terminal=false
-Djline.terminal=jline.UnsupportedTerminal
-Dgrails.console.class=grails.build.logging.GrailsEclipseConsole
-Dosgi.requiredJavaVersion=1.6
-Xms1024m
-Xmx2048m
-XX:PermSize=4096m
-XX:MaxPermSize=6144m
-XX:+UseParallelGC
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/ggts.icns

Is this a correct setup? Is there another way to solve this error?

Thank you all anyway.

Was it helpful?

Solution

Simo , take a look at the following settings.

1.Make sure your GGTS.INI file has not been touched since , you have installed it with gvm ,people compliant with that kind of install. Please, see that if you have any STS installed previously and Check that your STS.ini with GGTS.INI posted on your question.Some time increasing numbers doesn't solve the problem for me , just sticking it to original settings ,then tweak :).

Check this settings may be:

grails.project.fork = [
   test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true], // configure settings for the test-app JVM
   run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-app JVM
   war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-war JVM
   console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]// configure settings for the Console UI JVM
]

2.As dmahapatro said export the java_OPTS settings.If u are on Linux command line or widows environment varibles :

 export JAVA_OPTS="-XX:MaxPermSize=512m" //you can omit this if u want
 export GRAILS_OPTS="-server -Xmx512M -XX:MaxPermSize=512m -Dfile.encoding=UTF-8"
 grails run-app

3.To see what sort of setting is your jvm having try this one:

ps aux | grep java | less

4.Example of a working STS.INI settings

-vm
/usr/share/java/jdk1.6.0_30/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.XXMaxPermSize
384M
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Xmn128m
-Xss1m
-XX:PermSize=128m
-Dgrails.console.enable.interactive=false
-Dgrails.console.enable.terminal=false
-Djline.terminal=jline.UnsupportedTerminal
-Dgrails.console.class=grails.build.logging.GrailsEclipseConsole
-Dosgi.requiredJavaVersion=1.6
-Xms512m
-Xmx4096m
-XX:MaxPermSize=512m

//WITH no GRAILS_OPT AND JAVA_OPT on environment settings.try to reset it with this one.

Happy coding :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top