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...!!

Thursday, June 9, 2016

Solve Jenkins and Subversion time sync issue

You will notice below warning when your Jenkins server and Subversion server have different times (not in a time sync status)

WARNING: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.

There are two ways to sync Jenkins server with svn.
  1. Based on Jenkins time and svn time
  2. Based on Jenkins revision number and snv revision number

Before build projects Jenkins takes updates from svn. If times are not synced changes will not reflect properly. To solve this issue you can configure Jenkins to take updates based on head revision. Fix is simple.
You just have to add @HEAD to the end of your svn url.

for example:
If your previous svn url is 'http://your.svn.server/svnroot/your/code/location'
add @HEAD to the end of url.
New url is 'http://your.svn.server/svnroot/your/code/location@HEAD'

This will solve Jenkins and svn out of sync issues.


Cheers..!!