[
https://issues.apache.org/jira/browse/PDFBOX-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15636896#comment-15636896
]
ASF subversion and git services commented on PDFBOX-3555:
---------------------------------------------------------
Commit 1768061 from [~lehmi] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1768061 ]
PDFBOX-3555: call Inflater#end to release resources as proposed by Yoan Alvarez
> FlateFilter.decode cause native memory leaks
> --------------------------------------------
>
> Key: PDFBOX-3555
> URL: https://issues.apache.org/jira/browse/PDFBOX-3555
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.3
> Environment: Debian wheezy 7.11 / oracle JDK 8 - 64 bit / pdfbox 2.0.3
> Reporter: Yoan Alvarez
> Assignee: Andreas Lehmkühler
>
> The
> [FlateFilter.decode|https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java#L45]
> method calls the private method
> [FlateFilter.decompress|https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java#L89]
> which instanciates a
> [java.util.zip.Inflater|https://docs.oracle.com/javase/8/docs/api/java/util/zip/Inflater.html].
> But this method never calls the
> [Inflater.end|https://docs.oracle.com/javase/8/docs/api/java/util/zip/Inflater.html#end--]
> method so I think the native memory allocated by the Inflater is never
> released.
> By consequence, the java process memory size keeps growing over time.
> The simplest way we found to fix this is to call the
> [Inflater.end|https://docs.oracle.com/javase/8/docs/api/java/util/zip/Inflater.html#end--]
> when the inflater has done its job and is not used anymore at the end of
> [FlateFilter.decompress|https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java#L136].
> With this fix, the java process memory size remains stable over time.
> Just ask me if more details are needed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]