My Scala project (Maven-managed) is failing to build on Travis, throwing a GC overhead limit exceeded
error despite compiling fine locally with the same MAVEN_OPTS=-Xmx3g -XX:MaxPermSize=512m
. I suspect that Travis is somehow ignoring my MAVEN_OPTS
: When I try to test against Oracle JDK 8, Travis logs:
$ Setting environment variables from .travis.yml
$ export MAVEN_OPTS="-XX:MaxPermSize=512m -Xmx3g"
which looks good. However, soon after it logs:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
which is troubling since NOWHERE am I specifying -XX:MaxPermSize=192m
, only 512m
. (This leads me to believe my -Xmx3g
is also being ignored, causing the compilation failure.)
I tried specifying the MAVEN_OPTS
in many additional places in my pom, to no avail. For example, for the maven-scala-plugin, I have:
<configuration>
...
<jvmArgs>
<jvmArg>-Xmx3g</jvmArg>
<jvmArg>-XX:MaxPermSize=512m</jvmArg>
</jvmArgs>
</configuration>
And I also have the following under the maven-surefire-plugin and scalatest plugin, though the build is failing during compilation not tests:
<configuration>
<argLine>-Xmx3g -XX:MaxPermSize=512m</argLine>
</configuration>
The following is the entirety of my .travis.yml:
language: java
env:
global:
- MAVEN_OPTS="-XX:MaxPermSize=512m -Xmx3g"
script: mvn clean install
jdk:
- oraclejdk8
- oraclejdk7
I'm using Scala 2.11.2 and scala-maven-plugin 3.2.0.