Saturday, June 11, 2016

Solve Jenkins Maven jobs build fail due to OutOfMemoryError

There are two major OutOfMemoryError types.

  1. java.lang.OutOfMemoryError: Heap space
  2. java.lang.OutOfMemoryError: PermGen space
You can easily solve this by adding/changing Jenkins environment variables.
Go to
Manage Jenkins >> Configure System >> 
In the Global Properties section check the Environment Variables check box.

Then add parameters as below
Name: MAVEN_OPTS
Value: -Xmx1024m -XX:MaxPermSize=1024m

Setting Xmx will solve your Heap Space issue and setting XX:MaxPermSize will solve your PermGen Space issues.


Cheers...!!

No comments:

Post a Comment