I have a Maven project, which builds 6 separate Maven projects in Jenkins. The problem I face is that over the time the project build fails giving the 137 error code:
<
I was running into the same behavior on our build server. The error is IMHO not associated with the maven memory settings (i.e. MAVEN_OPTS
) but rather with the memory of the underlying (Linux) machine itself (which Jenkins runs on).
The (rejected) Jenkins issue https://jenkins-ci.org/issue/12035 gives more detail on this matter:
For reference the status code 137 (128 + 9) typically means (can differ between flavours of unix). That the process was terminated by receipt of a signal. In this case signal 9 which is SIGKILL and unblockable kill.
If this is the case the underlying machine/OS needs more virtual memory. This can be added by either adding physical memory or swap space as appropriate.
You should try to increase the virtual memory of your machine.
Note:
This also explains why a Jenkins restart (temporarily) fixes the issue.