At times, you may find that your server is being taxed too much by your builds. Sometimes these can result in JVM crashes. These can be particularly difficult to troubleshoot since it could also be issues with your build.
However here are a few general suggestions to try:
- Use the env variable to see if we can increase it further
An example for gradle would be GRADLE_OPTS=-Xmx512m
An example for maven would be MAVEN_OPTS=-Xmx512m
- Try increasing through your "wrapper" see http://stackoverflow.com/a/17701809 for a gradle example.
- Set global props within jenkins (pic on https://wiki.jenkins-ci.org/display/JENKINS/Builds+failing+with+OutOfMemoryErrors )
- Try setting JVM in some of the options to see if it somehow is overwriting our build specific (gradle, maven, etc) options.
- Remove those options from your build script (ie. gradle.buildscript, etc.) and add a new file on the same folder as where your build file (ie. gradle.build) lives called‘gradle.properties’ from http://www.gubatron.com/blog/2014/07/29/solved-gradle-how-to-increase-the-java-compilers-available-heap-memory/. In theory this could be applied to maven too.