You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2016/11/04 16:35:58 UTC

[jira] [Updated] (PDFBOX-3555) FlateFilter.decode cause native memory leaks

     [ https://issues.apache.org/jira/browse/PDFBOX-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-3555:
---------------------------------------
    Fix Version/s: 2.1.0
                   2.0.4
                   1.8.13

> 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: 1.8.12, 2.0.3, 2.1.0
>         Environment: Debian wheezy 7.11 / oracle JDK 8 - 64 bit / pdfbox 2.0.3
>            Reporter: Yoan Alvarez
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.8.13, 2.0.4, 2.1.0
>
>
> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org