Jenkins Maven版本137错误 [英] Jenkins Maven Build 137 Error

查看:1557
本文介绍了Jenkins Maven版本137错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Maven项目,该项目在Jenkins中构建了6个独立的Maven项目.我面临的问题是,随着时间的推移,项目构建失败并给出137错误代码:

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:

错误:Maven JVM意外终止,退出代码为137

ERROR: Maven JVM terminated unexpectedly with exit code 137

可以在控制台中使用相同的Maven目标成功构建项目,但是在Jenkins中失败.通过重新启动Jenkins,可以解决该问题.

The project could be built successfully using same Maven goals in the console, but in Jenkins it fails. By restarting Jenkins the problem can be resolved.

我有一些静态数组列表.这些列表用于一些测试用例.这可能是内存泄漏吗?

I have some static array lists. These lists are used for some test cases. Could this be a memory leak?

推荐答案

我在构建服务器上遇到了相同的行为.错误是恕我直言,它与Maven内存设置(即MAVEN_OPTS)无关,而是与基础(Linux)计算机本身(Jenkins在其上运行)的内存有关.

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

(被拒绝的)詹金斯期刊 https://jenkins-ci.org/issue/12035 详细介绍了这件事:

The (rejected) Jenkins issue https://jenkins-ci.org/issue/12035 gives more detail on this matter:

作为参考,状态码137(128 + 9)通常表示(在Unix风格之间可能有所不同).接收到信号终止了该过程.在这种情况下,信号9是SIGKILL和不可阻止的杀死.

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重新启动(临时)可以解决此问题.

Note:
This also explains why a Jenkins restart (temporarily) fixes the issue.

这篇关于Jenkins Maven版本137错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆