java.lang.OutOfMemoryError: Java heap space

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • From Jason D Smith: Situation: A user has a 6mb spreadsheet. They attached it to page A. On page B, they used the Excel macro to embed the spreadsheet. Result: On page load, Confluence runs out of memory. Troubleshooting done: We have a ticket open with Atlassian. After they analyzed a heap dump, they pointed us to the page in question. I replicated this problem (OOM) with the same spreadsheet in our dev environment of Confluence. We also tried using the “Office Excel” macro and it said that it wouldn’t allow it because the file was over 2MB. Expected results (?): Plugin either rejects files over a certain size (maybe 2MB) in order to prevent OOM, or it becomes more robust in its rendering of them in order to avoid OOM. More info: We have over 12GB in total heap. At the moment, for reference, we have 6GB free heap, so it’s not like we were already against the wall in terms of memory. This quote is from Atlassian: bq. “Looks like the log files show exactly one of the pages that cause the issue: {noformat} 2016-09-08 11:13:01,969 ERROR [http-nio-8090-exec-20] [xhtml.view.macro.ViewMacroMarshaller] marshalInternal Error rendering macro: excel -- referer: https://confluence.teslamotors.com/display/NPI/Powertrain | url: /display/NPI/%28Live%29+Powertrain+Trials | userName: bdecker | action: viewpage | page: 42711013 java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3332) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421) at java.lang.StringBuilder.append(StringBuilder.java:136) at org.swift.confluence.excel.PoiSupport.generateOutput(PoiSupport.java:271) at org.swift.confluence.excel.PoiSupport.getPOIOutput(PoiSupport.java:137) at org.swift.confluence.excel.PoiSupport.process(PoiSupport.java:66) at org.swift.confluence.excel.ExcelMacro.execute(ExcelMacro.java:154) at org.swift.confluence.scriptutil.ScriptMacro.execute(ScriptMacro.java:161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:203) at com.sun.proxy.$Proxy2129.execute(Unknown Source) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.executeMacro(ViewMacroMarshaller.java:229) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:156) {noformat}
    via by Jason Smith,
  • OutOfMemory with JMH and Mode.AverageTime
    via Stack Overflow by Laurent
    ,
  • GitHub comment 20#140366924
    via GitHub by Pawamoy
    ,
    • java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3332) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421) at java.lang.StringBuilder.append(StringBuilder.java:136) at org.swift.confluence.excel.PoiSupport.generateOutput(PoiSupport.java:271) at org.swift.confluence.excel.PoiSupport.getPOIOutput(PoiSupport.java:137) at org.swift.confluence.excel.PoiSupport.process(PoiSupport.java:66) at org.swift.confluence.excel.ExcelMacro.execute(ExcelMacro.java:154) at org.swift.confluence.scriptutil.ScriptMacro.execute(ScriptMacro.java:161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:203) at com.sun.proxy.$Proxy2129.execute(Unknown Source) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.executeMacro(ViewMacroMarshaller.java:229) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:156)

    Users with the same issue

    Unknown visitor1 times, last one,
    Handemelindo
    Handemelindo1 times, last one,
    harshg
    harshg2 times, last one,
    sunils
    sunils1 times, last one,
    mortalman7
    mortalman71 times, last one,
    57 more bugmates