Groovy Compiler runs out of memory
Hello guys,
I've a problem compiling my Grails-project, because the Groovy compiler runs out of memory (build log is attached below). I've tried various settings, but none of them worked. I tweaked all the different UI settings regarding the compiler / build process, and I added "groovy.compiler.Xmx=4096M" to the ideas.properties file. But the JVM process, that IntelliJ launches for the groovy compiler, is always configured with "-Xmx400m", as JVisualVM depicts.
Is it even possible to increase the heap size for the groovy compiler? Or may the compiler run in the same JVM as IntelliJ?
Thank you and best regards.
Information:Groovyc: While compiling xxx:java.lang.OutOfMemoryError: Java heap space
at org.codehaus.groovy.ast.ClassNode.<init>(ClassNode.java:332)
at org.codehaus.groovy.ast.ClassNode.<init>(ClassNode.java:303)
at org.codehaus.groovy.ast.ClassHelper.makeWithoutCaching(ClassHelper.java:207)
at org.codehaus.groovy.vmplugin.v5.Java5.configureTypeVariableReference(Java5.java:143)
at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:92)
at org.codehaus.groovy.vmplugin.v5.Java5.configureTypeArguments(Java5.java:157)
at org.codehaus.groovy.vmplugin.v5.Java5.configureParameterizedType(Java5.java:137)
at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:88)
at org.codehaus.groovy.vmplugin.v5.Java5.makeClassNode(Java5.java:385)
at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:330)
at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:262)
at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:381)
at org.codehaus.groovy.grails.compiler.injection.AbstractGrailsArtefactTransformer.performInjectionOnAnnotatedClass(AbstractGrailsArtefactTransformer.java:153)
at org.codehaus.groovy.grails.compiler.injection.AbstractGrailsArtefactTransformer.performInjection(AbstractGrailsArtefactTransformer.java:93)
at org.codehaus.groovy.grails.compiler.injection.GrailsAwareInjectionOperation.call(GrailsAwareInjectionOperation.java:144)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1027)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:542)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:519)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:134)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain(GroovycRunner.java:100)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:68)
Please sign in to leave a comment.
Hello,
How do you run compilation - via "Build | Build Project" or using Grails task?
The problem occurs when using"Build | Build Project". When I build the project via Maven, then it works, because I can configure the memory settings there.
Do you face this problem with other projects? Could you please create new issue on YouTrack ( http://youtrack.jetbrains.com/issues/IDEA) attaching full logs folder zipped and Memory dump: https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems ?
That's my first project with IntelliJ. I created the issue, as you suggested:
https://youtrack.jetbrains.com/issue/IDEA-195598