Skip to content

Large files result in out of memory error #262

@AdMSilvan

Description

@AdMSilvan

During testing ODS files over 50MB have run into an OOM error. Here is an example of an error message:
APP-1: [INFO] Validating C:\Temp\OdsFiles\019846fd-f252-7d85-9970-fd373d693760.ods.
Exception in thread "main" java.lang.OutOfMemoryError: Required array length 2147483639 + 9 is too large
at java.base/jdk.internal.util.ArraysSupport.hugeLength(ArraysSupport.java:914)
at java.base/jdk.internal.util.ArraysSupport.newLength(ArraysSupport.java:907)
at java.base/java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:100)
at java.base/java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:132)
at java.base/java.io.InputStream.transferTo(InputStream.java:796)
at org.openpreservation.format.zip.ZipFileProcessor.getEntryInputStream(ZipFileProcessor.java:118)
at org.openpreservation.odf.pkg.PackageParserImpl.checkZipEntries(PackageParserImpl.java:138)
at org.openpreservation.odf.pkg.PackageParserImpl.parsePackage(PackageParserImpl.java:110)
at org.openpreservation.odf.pkg.PackageParserImpl.parsePackage(PackageParserImpl.java:81)
at org.openpreservation.odf.validation.ValidatingParserImpl.parsePackage(ValidatingParserImpl.java:77)
at org.openpreservation.odf.validation.Validator.validatePackage(Validator.java:108)
at org.openpreservation.odf.validation.Validator.validate(Validator.java:88)
at org.openpreservation.odf.apps.CliValidator.validatePath(CliValidator.java:74)
at org.openpreservation.odf.apps.CliValidator.call(CliValidator.java:54)
at org.openpreservation.odf.apps.CliValidator.call(CliValidator.java:34)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.openpreservation.odf.apps.CliValidator.main(CliValidator.java:98)

Thank you for your support with this error!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions