简体   繁体   English

Jenkins中的堆空间问题

[英]Heap Space issue in Jenkins

In Jenkins, we are getting following error. 在詹金斯,我们得到以下错误。 It shows Out Of Memory Error . 显示Out Of Memory Error I increased heap size from 256 to 1024 but this is still not working. 我将堆大小从256增加到1024,但这仍然无法正常工作。 When I increase heap size from 1024 to 2048 then Jenkins service does not work. 当我将堆大小从1024增加到2048时,Jenkins服务不起作用。 I made all these changes in Jenkins.xml file. 我在Jenkins.xml文件中进行了所有这些更改。

BUILD FAILED
D:\Jenkins_Build\build_cs\cartridge\build\build.xml:2034: The following error occurred while executing this line:
D:\Jenkins_Build\build_cs\cartridge\build\build.xml:1662: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown Source)
    at java.io.ByteArrayOutputStream.grow(Unknown Source)
    at java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source)
    at java.io.ByteArrayOutputStream.write(Unknown Source)
    at org.apache.commons.httpclient.methods.InputStreamRequestEntity.bufferContent(InputStreamRequestEntity.java:137)
    at org.apache.commons.httpclient.methods.InputStreamRequestEntity.getContentLength(InputStreamRequestEntity.java:187)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.getRequestContentLength(EntityEnclosingMethod.java:336)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.addContentLengthRequestHeader(EntityEnclosingMethod.java:406)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.addRequestHeaders(EntityEnclosingMethod.java:374)
    at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2177)
    at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2060)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at com.demandware.deploy.WebDavHelper.doPutAndUnzip(WebDavHelper.java:152)
    at com.demandware.deploy.WebDavHelper.uploadZip(WebDavHelper.java:87)
    at com.demandware.deploy.DeployCartridgesTask.execute(DeployCartridgesTask.java:148)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

You perform an ant build. 您执行一个蚂蚁建造。 Therefore you must increase the heap of your ant build and not the heap of the jenkins server. 因此,您必须增加您的ant构建的堆,而不是jenkins服务器的堆。

Take a look at How to use the `Java Options` in jenkins ant build tool to set ANT_OPTS 看一下如何在jenkins ant生成工具中使用Java选项设置ANT_OPTS

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

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