詹金斯的堆空间问题

时间:2014-11-26 11:32:22

标签: java jenkins

在Jenkins,我们遇到了以下错误。它显示Out Of Memory Error。我将堆大小从256增加到1024,但这仍然无法正常工作。当我将堆大小从1024增加到2048时,Jenkins服务不起作用。我在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)

1 个答案:

答案 0 :(得分:1)

执行ant构建。因此,您必须增加ant构建的堆,而不是jenkins服务器的堆。

查看How to use the `Java Options` in jenkins ant build tool to set ANT_OPTS