mercredi 24 mars 2021

define grails memory settings while testing

I have a grails 4.0.2 application with a integration test that requires a large amount of memory.

Currently when I run the test it fails with: java.lang.OutOfMemoryError: GC overhead limit exceeded. In older grails you could define grails.project.fork in build.config.

Additionally,I've tried specifying GRAILS_OPTS with desired memory configurations but this gives me the message -> ignoring option MaxPermSize=512m; support was removed in 8.0

I've also tried adjusting build.gradle to the below

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

tasks.withType(GroovyCompile) {
    configure(groovyOptions) {
        forkOptions.jvmArgs = ['-Xmx2048m']
    }
}

What is the correct way of specifying memory settings for testing grails 4?

Aucun commentaire:

Enregistrer un commentaire