简体   繁体   English

詹金斯中的永久代空间问题

[英]PermGen Space issue in Jenkins

I am building a maven project, since last 1.5 yrs build was working fine but now I am getting the PermGen space error.我正在构建一个 maven 项目,因为过去 1.5 年的构建工作正常,但现在我遇到了 PermGen 空间错误。

[ERROR] Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: java.io.IOException: Remote call on channel failed: PermGen space -> [Help 1]
[ERROR] org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
java.lang.OutOfMemoryError: PermGen space

I have tried below options in order to resolve it:-我尝试了以下选项以解决它:-

1) Under Manage Jenkins , then Configure System . 1) 在Manage Jenkins 下,然后Configure System In the Global properties section, added Environment Variables called MAVEN_OPTS with the value set as -Xmx200m -XX:MaxPermSize=512m全局属性部分,添加名为 MAVEN_OPTS 的环境变量,其值设置为-Xmx200m -XX:MaxPermSize=512m

2) Under job configuration , then Build , in the MAVEN_OPTS , added below properties:- 2) 在job configuration 下,然后Build ,在MAVEN_OPTS 中,添加以下属性:-

-DXms512m
-DXmx1024m
-DXX:PermSize=512m
-DXX:MaxPermSize=1024m
-DXX:+CMSClassUnloadingEnabled
-DXX:+UseConcMarkSweepGC

Still the error is occurring.仍然发生错误。

Note:- Error is not permanent, it goes away after few builds but again start appearing and then again goes away after several retries.注意:-错误不是永久性的,它在几次构建后消失,但再次开始出现,然后在多次重试后再次消失。

Thanks.谢谢。

Maybe I'm wrong, but it seems that your memory error happens when Jenkins try to send the build information to Artifactory (with a post step action).也许我错了,但是当 Jenkins 尝试将构建信息发送到 Artifactory(使用后期操作)时,您的内存错误似乎发生了。

Did you upgrade the Jenkins Artifactory plugin recently?您最近是否升级了 Jenkins Artifactory 插件?

Can you try do disable the "Capture and publish build info" option?您可以尝试禁用“捕获并发布构建信息”选项吗?

在此处输入图片说明

And last option, can you try update the JENKINS_JAVA_OPTIONS (in the jenkins service config file) to increase the MaxPermSize?最后一个选项,您能否尝试更新 JENKINS_JAVA_OPTIONS(在 jenkins 服务配置文件中)以增加 MaxPermSize?

## Type: string
## Default:     "-Djava.awt.headless=true"
## ServiceRestart: jenkins
#
# Options to pass to java when running Jenkins.
#
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xms2G -Xmx4G -XX:MaxPermSize=256m"

As Maven project deploys artifacts not during build step on a node , but on the master , I suspect Permgen problem could by resolved by either upgrading Jenkins core, plugins or by increasing Permgen max size in Jenkins startup options.由于 Maven 项目不是节点上的构建步骤中部署工件,而是在master上部署工件,我怀疑 Permgen 问题可以通过升级 Jenkins 核心、插件或通过增加 Jenkins 启动选项中的 Permgen 最大大小来解决。

ps.附: Java 8 obsoletes Permgen. Java 8 淘汰了 Permgen。

maybe I am blind and you have written it somewhere but when I have faced a similar issue, then I have upgraded the JRE version for Jenkins itself from 7 to 8. The problem started, when I have used Jenkins 2.X and Java 7.也许我瞎了,你写在某个地方,但是当我遇到类似的问题时,我将 Jenkins 本身的 JRE 版本从 7 升级到 8。当我使用 Jenkins 2.X 和 Java 7 时,问题就开始了。

Best regards,此致,

Max最大限度

on centos6 install jenkins by rpm or yum在 centos6 上通过 rpm 或 yum 安装 jenkins

vim /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=512m"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM