Grails4 getting out of memory while compiling groovy

Viewed 141

I am getting below out of memory error in my grails4 application after adding more controllers in my workspace.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':cira:compileGroovy'.

    GC overhead limit exceeded

so far i have total of 41 controller files in my grails application while adding 42 one i am getting this error while compiling if i remove it and run with existing 41 controllers its working.

Please let me know if you have any solution for this.

Thanks in Advance!

1 Answers

Modify bootRun block of build.gradle as follows

bootRun {
ignoreExitValue true
jvmArgs(
    '-Dspring.output.ansi.enabled=always',
    '-noverify',
    '-XX:TieredStopAtLevel=1',
    '-Xmx4096m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, 
System.getProperty(springProfilesActive)
}
Related