2

I have a maven build running on Travis (dockerized) which builds just fine on my command line. Since a couple of days I get java.lang.OutOfMemoryError: GC overhead limit exceeded during the test cases. This happens always during the AspectJ test cases.

The output of the last build is https://travis-ci.org/dresden-ocl/dresdenocl/builds/53030457.

I did not made any intensive changes. And I did not touch the AspectJ part of the application. I tested various things with JAVA_OPTS, MAVEN_OPTS and even passing more RAM in the pom.xml for tycho-surefire-plugin. Nothing helped.

How can I get rid of the error and make all my tests run again? I think they changed anything on Travis' side that is causing the error.

lschuetze
  • 1,218
  • 10
  • 25

3 Answers3

1

GC overhead limit exceeded means that your JVM is spending the most of the time in garbage collection which indicates some serious problems. This could not be fixed through JAVA_OPTS or MAVEN_OPTS because this is a programming (code) problem. You can try to add

-XX:-UseGCOverheadLimit

but thats not recommended. For further information see this and that.

Community
  • 1
  • 1
Jan
  • 1,004
  • 6
  • 23
  • How could it be that this was not causing problems for a year and now suddenly always makes the build fail on Travis? – lschuetze Mar 04 '15 at 12:43
  • That's quite difficult to guess without access to code and build enviroment. You should check what changed between clean run and first occur of this exception. Since it within your test: Could it be that your build up a huge test enviroment which executes just a short test? But that's just a guess of me... – Jan Mar 04 '15 at 12:51
1

The solution is stated here and references an issue how Travis CI provides MAVEN_OPTS. So if you are not fine with provided MAVEN_OPTS values you are not able to build in an containerized environment, because there is no sudo available.

before_install: 
  - sudo rm /etc/mavenrc
  - export M2_HOME=/usr/local/maven
  - export MAVEN_OPTS="-Dmaven.repo.local=$HOME/.m2/repository -Xms1024m -Xmx3072m -XX:PermSize=512m"

This pull request will make your changes to MAVEN_OPTS work. Thus, you can change MAVEN_OPTS without having to use the workaround above and therefore can use containerized builds with Maven.

Community
  • 1
  • 1
lschuetze
  • 1,218
  • 10
  • 25
1

Try increasing your stack size, e.g. by ulimit -s 82768 and re-try. To check the limits, run ulimit -a or free -m for free memory.

kenorb
  • 155,785
  • 88
  • 678
  • 743