Grails task fails in Bamboo build - OutOfMemoryError
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Grails task fails when running a Bamboo build, and this error is in the build logs:
1
2
3
4
5
build 19-Aug-2013 14:51:45 | Packaging Grails application.....
build 19-Aug-2013 14:51:57 | Tests FAILED - view reports in /mnt/bamboo5/xml-data/build-dir/PROJ1-WEB-JOB1/target/test-reports
build 19-Aug-2013 14:51:58 | Error Error executing script TestApp: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'syncTriggerTrigger': ... Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler': Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: unable to create new native thread (Use --stacktrace to see the full trace)
simple 19-Aug-2013 14:51:58 Failing task since return code of [/opt/grails/bin/grails test-app -non-interactive] was 1 while expected 0
...
Cause
Lack of memory for the Grails build or for the VM (if one is being used).
Resolution
Seeing OutOfMemoryError in the logs recommends increasing the heap for the Grails task. Please try to use this option (as it's mentioned here) in the Environment Variables field to increase the heap of the of the Grails task:
1
GRAILS_OPTS="-Xmx512M"
Alternatively, if you are running your build in a virtual environment, make sure that there is enough memory allocated to the VM.
Was this helpful?