java.lang.OutOfMemoryError: Java heap space

Atlassian JIRA | Bob Swift [Bob Swift Atlassian Add-ons] | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Confluence CLI is being used, but it doesn't do much other than call the *addAttachment* Remote API service. The [documentation|https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs] says: bq. Note that this uses a lot of memory - about 4 times the size of the attachment. Can attach files around 3 MBs, but problems when larger files. 13 MBs fails (see https://studio.plugins.atlassian.com/browse/CSOAP-114). I attempted 23 MBs with a 4GB java heap size. Same file can be attached via UI fine. {noformat} java.lang.OutOfMemoryError: Java heap space; nested exception is: java.lang.OutOfMemoryError: Java heap space at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at org.swift.common.soap.confluence.ConfluenceserviceV2SoapBindingStub.addAttachment(ConfluenceserviceV2SoapBindingStub.java:4857) at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1707) at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1646) at org.swift.confluence.cli.ConfluenceClient.handleRequest(ConfluenceClient.java:471) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119) at org.swift.common.cli.CliClient.doWork(CliClient.java:225) at org.swift.confluence.cli.ConfluenceClient.main(ConfluenceClient.java:115) {noformat} h4. Workaround - Attach the file through Confluence interface - Use "doattachfile.action" controller using a tool like [curl|http://curl.haxx.se/], so your command line would look like: {noformat} curl -F file_0=@<path to file> -F pageId=<confluence page id> -u <username>:<password> "http://Confluence-URL/pages/doattachfile.action" {noformat} or, - Use WebDAV and intermediary mean to upload/attach files. For more details on this, please review the following docs: https://confluence.atlassian.com/display/DOC/Configuring+a+WebDAV+client+for+Confluence https://confluence.atlassian.com/display/AOD/Uploading+Data+via+WebDAV

    Atlassian JIRA | 5 years ago | Bob Swift [Bob Swift Atlassian Add-ons]
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    Confluence CLI is being used, but it doesn't do much other than call the *addAttachment* Remote API service. The [documentation|https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs] says: bq. Note that this uses a lot of memory - about 4 times the size of the attachment. Can attach files around 3 MBs, but problems when larger files. 13 MBs fails (see https://studio.plugins.atlassian.com/browse/CSOAP-114). I attempted 23 MBs with a 4GB java heap size. Same file can be attached via UI fine. {noformat} java.lang.OutOfMemoryError: Java heap space; nested exception is: java.lang.OutOfMemoryError: Java heap space at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at org.swift.common.soap.confluence.ConfluenceserviceV2SoapBindingStub.addAttachment(ConfluenceserviceV2SoapBindingStub.java:4857) at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1707) at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1646) at org.swift.confluence.cli.ConfluenceClient.handleRequest(ConfluenceClient.java:471) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119) at org.swift.common.cli.CliClient.doWork(CliClient.java:225) at org.swift.confluence.cli.ConfluenceClient.main(ConfluenceClient.java:115) {noformat} h4. Workaround - Attach the file through Confluence interface - Use "doattachfile.action" controller using a tool like [curl|http://curl.haxx.se/], so your command line would look like: {noformat} curl -F file_0=@<path to file> -F pageId=<confluence page id> -u <username>:<password> "http://Confluence-URL/pages/doattachfile.action" {noformat} or, - Use WebDAV and intermediary mean to upload/attach files. For more details on this, please review the following docs: https://confluence.atlassian.com/display/DOC/Configuring+a+WebDAV+client+for+Confluence https://confluence.atlassian.com/display/AOD/Uploading+Data+via+WebDAV

    Atlassian JIRA | 5 years ago | Bob Swift [Bob Swift Atlassian Add-ons]
    java.lang.OutOfMemoryError: Java heap space
  3. 0

    OutofMemory Error while sending file to database using Web services

    Oracle Community | 1 decade ago | 807569
    java.lang.OutOfMemoryError: Java heap space
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.OutOfMemoryError: Java heap space

    Oracle Community | 1 decade ago | 843829
    java.lang.OutOfMemoryError: Java heap space
  6. 0

    java.lang.OutOfMemoryError

    Oracle Community | 1 decade ago | 843833
    java.lang.OutOfMemoryError: Java heap space

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.OutOfMemoryError

      Java heap space

      at org.apache.axis.message.SOAPFaultBuilder.createFault()
    2. Axis Web Services
      DeserializationContext.endElement
      1. org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
      2. org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
      3. org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
      3 frames
    3. Java RT
      SAXParser.parse
      1. com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
      2. com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
      3. com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
      4. com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      5. com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
      6. com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
      7. com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
      8. com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      9. com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
      10. com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
      11. com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
      12. javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
      12 frames
    4. Axis Web Services
      Call.invoke
      1. org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
      2. org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      3. org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      4. org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
      5. org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      6. org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      7. org.apache.axis.client.Call.invoke(Call.java:2767)
      8. org.apache.axis.client.Call.invoke(Call.java:2443)
      9. org.apache.axis.client.Call.invoke(Call.java:2366)
      10. org.apache.axis.client.Call.invoke(Call.java:1812)
      10 frames
    5. org.swift.common
      ConfluenceserviceV2SoapBindingStub.addAttachment
      1. org.swift.common.soap.confluence.ConfluenceserviceV2SoapBindingStub.addAttachment(ConfluenceserviceV2SoapBindingStub.java:4857)
      1 frame
    6. org.swift.confluence
      ConfluenceClient.handleRequest
      1. org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1707)
      2. org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1646)
      3. org.swift.confluence.cli.ConfluenceClient.handleRequest(ConfluenceClient.java:471)
      3 frames
    7. org.swift.common
      CliClient.doWork
      1. org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
      2. org.swift.common.cli.CliClient.doWork(CliClient.java:225)
      2 frames
    8. org.swift.confluence
      ConfluenceClient.main
      1. org.swift.confluence.cli.ConfluenceClient.main(ConfluenceClient.java:115)
      1 frame