miachm / SODS

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)
The Unlicense
74 stars 30 forks source link

"java.lang.OutOfMemoryError: GC overhead limit exceeded" when initializing SpreadSheet object with given ODS file #15

Closed vaxuser closed 4 years ago

vaxuser commented 4 years ago

"java.lang.OutOfMemoryError: GC overhead limit exceeded" is thrown when initializing SpreadSheet object with given ODS file (SODS version 1.2.1)

Attached sods.oom.tar.gz contains the problematic ODS file and a tiny Groovy script reproducing the error.

Steps Run Groovy script from the archive:

cd src
groovy brp-testdata-import.groovy

Result

Caught: java.lang.OutOfMemoryError: GC overhead limit exceeded java.lang.OutOfMemoryError: GC overhead limit exceeded at com.github.miachm.sods.Sheet.checkLazyRowLoading(Sheet.java:306) at com.github.miachm.sods.Sheet.getCell(Sheet.java:296) at com.github.miachm.sods.Range.iterateRange(Range.java:624) at com.github.miachm.sods.Range.setStyle(Range.java:718) at com.github.miachm.sods.OdsReader.processCells(OdsReader.java:413) at com.github.miachm.sods.OdsReader.processTable(OdsReader.java:279) at com.github.miachm.sods.OdsReader.processSpreadsheet(OdsReader.java:223) at com.github.miachm.sods.OdsReader.iterateFilesEntries(OdsReader.java:216) at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:77) at com.github.miachm.sods.OdsReader.load(OdsReader.java:43) at com.github.miachm.sods.OdsReader.load(OdsReader.java:35) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:52) at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:39) at brp-testdata-import.run(brp-testdata-import.groovy:4)

Environment

$ java -version java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

$ groovy -v Groovy Version: 2.5.9 JVM: 1.8.0_201 Vendor: Oracle Corporation OS: Linux

Notes ODS file downloaded from https://www.rvig.nl/documenten/richtlijnen/2018/09/20/testdataset-persoonslijsten-proefomgevingen-gba-v

miachm commented 4 years ago

Thanks for your report.

That is a file generated by Microsoft Office. ODS files generated by Microsoft are a bit "strange". They reserve an insane quantity of rows/columns and that cause Out Of Memory errors. More details in #12

There is a non-official solution which try to work-around these issues: https://github.com/miachm/SODS/files/3958194/SODS-1.2.2-snapshot.jar.zip

A definitive solution is expected for the next release.

vaxuser commented 4 years ago

@miachm I confirm that the issue doesn't replay on version 1.2.2 Thanks!

miachm commented 4 years ago

Perfect :)