Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-333

Exception in thread "main" java.lang.OutOfMemoryError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • odfdom-0.8.7, odfdom-0.8.8
    • None
    • odfdom, performance, simple api
    • None

    Description

      I have been facing an issue related to "Out of Memory", so I'm trying to read a ODS file with 1.4 MB and ODF code is throwing the following exception.

      Exception in thread "main" java.lang.OutOfMemoryError
      at java.util.Arrays.copyOfRange(Unknown Source)
      at java.util.Arrays.copyOf(Unknown Source)
      at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:105)
      at org.odftoolkit.odfdom.pkg.StreamHelper.stream(StreamHelper.java:74)
      at org.odftoolkit.odfdom.pkg.StreamHelper.transformStream(StreamHelper.java:48)
      at org.odftoolkit.odfdom.pkg.OdfPackage.getBytes(OdfPackage.java:1584)
      at org.odftoolkit.odfdom.pkg.OdfPackage.getInputStream(OdfPackage.java:1650)
      at org.odftoolkit.odfdom.pkg.OdfFileDom.initialize(OdfFileDom.java:137)
      at org.odftoolkit.odfdom.dom.OdfContentDom.initialize(OdfContentDom.java:60)
      at org.odftoolkit.odfdom.pkg.OdfFileDom.<init>(OdfFileDom.java:87)
      at org.odftoolkit.odfdom.dom.OdfContentDom.<init>(OdfContentDom.java:50)
      at org.odftoolkit.odfdom.pkg.OdfFileDom.newFileDom(OdfFileDom.java:110)
      at org.odftoolkit.odfdom.pkg.OdfPackageDocument.getFileDom(OdfPackageDocument.java:280)
      at org.odftoolkit.odfdom.dom.OdfSchemaDocument.getFileDom(OdfSchemaDocument.java:393)
      at org.odftoolkit.odfdom.dom.OdfSchemaDocument.getContentDom(OdfSchemaDocument.java:197)
      at org.odftoolkit.simple.Document.getContentRoot(Document.java:762)
      at org.odftoolkit.simple.SpreadsheetDocument.getContentRoot(SpreadsheetDocument.java:217)

      I know that ODF files are like zip files, so I changed the extension to "zip" and extracted to a folder, it seems like the folder size is 180MB.

      Beside that I exported the content to a "xls" file and I used POI to perform the same operation and seemed to work ok with POI. Seems like ODFtoolkit doesn't has support to read big files.

      I notice that the content is stored in a XML file, thinking about it, seems like ODF is using DOM instead of SAX parser.

      Is there any one who can help me to fix this problem?

      I'm attaching the "ods" file with the data that throws the out of memory.

      Many thanks

      Attachments

        1. bigFile.ods
          1.29 MB
          Vicente Villegas Larios
        2. odftoolkit-333-test.zip
          46 kB
          Nimarukan

        Activity

          People

            Unassigned Unassigned
            cei37 Vicente Villegas Larios
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: