MINAKAMI Hiroki created PDFBOX-4167:
---------------------------------------
Summary: OutOfMemoryError on FlateFilter - Deflater.end() is
missing
Key: PDFBOX-4167
URL: https://issues.apache.org/jira/browse/PDFBOX-4167
Project: PDFBox
Issue Type: Bug
Components: Writing
Affects Versions: 2.0.9, 2.0.8
Environment: Windows 7 x64, Java 8 SE
Reporter: MINAKAMI Hiroki
While creating some large PDF documents by PDFBox 2.0.8 and 2.0.9, I met an
OutOfMemoryError on FlateFilter.encode().
While creating some small PDF documents, there are no problems.
I checked the source code of org.apache.pdfbox.filter.FlateFilter.java, and I
found that calling of Deflater.end() method is missing.
When DeflaterOutputStream object is created by the 'new
DeflaterOutputStream(encoded,deflater)' constructor method (i.e. 'custom
deflater' is given),
DeflaterOutputStream.close() API does *not* call 'deflater.end()' method
automatically.
Deflater.end() method may be called by the finalizer at GC, of cource, but the
timing of GC is undecidable by user. So 'deflater.end()' method should be
called explicitly. Otherwise it may cause an OutOfMemoryError.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]