Maven JVM terminated unexpectedly with exit code 137

【问题】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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值