Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-64229

XLSX file conversion service causes OutOfMemoryError on Confluence server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 7.10.0
    • 7.4.8, 7.9.3
    • None

      Problem

      XLSX files can cause OutOfMemoryError on Confluence server during the file conversion.

      Environment

      • Confluence server

      Steps to Reproduce

      1. Attach an XLSX file to a page
        • The file used to replicate the problem had around 3.8k rows of floating-point numbers and around 80 graphs
      2. Save the page
      3. Try to preview the file by opening it

      Expected Results

      The file is converted and the preview loads without errors or memory pressure.

      Actual Results

      Heap usage spikes instantly and this is observed in the application logs:

      2021-04-15 10:38:15,534 ERROR [conversion-thread-0] [plugins.conversion.impl.TimeoutConversionRunnable] run Cannot convert. Execution error: 
       -- referer: http://localhost:8090/pages/resumedraft.action?draftId=1111111&draftShareId=623dbdcd-53c4-49c9-9a2e-111111111& | url: /rest/tinymce/1/macro/placeholder | traceId: 6b0fe3c05047bce4 | userName: admin
      java.lang.OutOfMemoryError: Java heap space
          at java.base/java.util.Arrays.copyOf(Arrays.java:3689)
          at java.base/java.util.ArrayList.grow(ArrayList.java:238)
          at java.base/java.util.ArrayList.grow(ArrayList.java:243)
          at java.base/java.util.ArrayList.add(ArrayList.java:486)
          at java.base/java.util.ArrayList.add(ArrayList.java:499)
          at com.aspose.cells.b.a.a.zf.a(Unknown Source)
          at com.aspose.cells.ziz.c(Unknown Source)
          at com.aspose.cells.ziz.a(Unknown Source)
          at com.aspose.cells.ziz.a(Unknown Source)
          at com.aspose.cells.ziz.a(Unknown Source)
          at com.aspose.cells.ziz.b(Unknown Source)
          at com.aspose.cells.zjf.aq(Unknown Source)
          at com.aspose.cells.zav.n(Unknown Source)
          at com.aspose.cells.zkq.b(Unknown Source)
          at com.aspose.cells.Chart.F(Unknown Source)
          at com.aspose.cells.zat.c(Unknown Source)
          at com.aspose.cells.zat.a(Unknown Source)
          at com.aspose.cells.zat.a(Unknown Source)
          at com.aspose.cells.zat.a(Unknown Source)
          at com.aspose.cells.zat.a(Unknown Source)
          at com.aspose.cells.zat.b(Unknown Source)
          at com.aspose.cells.zat.c(Unknown Source)
          at com.aspose.cells.zat.a(Unknown Source)
          at com.aspose.cells.a.d.zfo.a(Unknown Source)
          at com.aspose.cells.zbzn.a(Unknown Source)
          at com.aspose.cells.zbzn.a(Unknown Source)
          at com.aspose.cells.zbzn.a(Unknown Source)
          at com.aspose.cells.Workbook.a(Unknown Source)
          at com.aspose.cells.Workbook.save(Unknown Source)
          at com.aspose.cells.Workbook.save(Unknown Source)
          at com.atlassian.plugins.conversion.convert.image.CellsConverter.convertToPDF(CellsConverter.java:139)
          at com.atlassian.plugins.conversion.convert.image.CellsConverter.convertDocDirect(CellsConverter.java:113)
      

      Inspecting the heap dump, we can see a huge array with 354 million elements using most of the memory:

      Workaround

      If you can't migrate to DC or if the migration will take a while to happen, one possibility to avoid this issue is to disable the conversion service. This can be achieved as follows:

      1. Go to Cog Icon > Add-ons
      2. Locate the Confluence Document Conversion Library system add-on
      3. Disable the File Conversions (file-conversions) module

      That will disable the file preview macro. It is also important to disable the Office Excel macro as follows:

      1. Go to Cog Icon > Add-ons
      2. Locate the Office Connector plugin system add-on
      3. Disable the viewxls (viewxls-legacy) and viewxls (viewxls) modules

      In that scenario, we have the conversion service disabled for all file types, so the Preview (view-file) macro will no longer work. Also, the Office Excel macro will be disabled, but other file types can still be previewed with their respective macros (Office Word, Office PowerPoint, and PDF).

      Notes

      This issue does not affect Confluence Data Center as the file conversion is handled on the external process pool:

      Also, this bug does not affect versions 7.10 and newer of Confluence server. This is due to an upgrade in the Aspose library which mitigates the memory pressure observed in older versions.

        1. sample.xlsx
          2.12 MB
        2. screenshot-IBM.png
          screenshot-IBM.png
          1.42 MB

              Unassigned Unassigned
              bandreeti Bernardo Andreeti
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h