【问题】jenkins自动部署报错,Maven JVM terminated unexpectedly with exit code 137
Maven JVM terminated unexpectedly with exit code 137
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.
jenkins编译的时候报的错,其实正常编译完了,但是结果是失败的,也没有变红
内存不够了,先尝试杀掉些没有用的进程先用着,然后申请服务器加内存吧。。。。
原文:http://stackoverflow.com/questions/24989653/jenkins-maven-build-137-error
【解决方案】设置Maven的JVM参数
使用Maven突然出现了Java heap space,一般出现这个问题就是堆内存不够了,这时候需要修改JVM参数,查看Maven的可执行文件。在${MAVEN_HOME}/bin目录下,存在两个文件,mvn和mvn.bat(mvn.cmd)。
如果是windows,则修改mvn.bat(mvn.cmd)文件,如果是linux,则修改mvn文件。
mvn.bat(mvn.cmd):
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
以上注释用来设置JVM参数,如果需要是堆内存不够,则设置最大堆大小-Xmx,如果是持久代溢出,比如出现PermGen space异常,则设置-XX:MaxPermSize即可。 例如以下设置最大堆大小为512M,持久代最大为512M。对于JVM的参数的意义,可以查看具体的文档。
set MAVEN_OPTS=-Xmx512M -XX:MaxPermSize=512M
mvn:和上面类似
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-----end-----