You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/10/06 23:02:26 UTC

[jira] [Updated] (PDFBOX-3008) Memory leak in preflight

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

Tilman Hausherr updated PDFBOX-3008:
------------------------------------
    Description: 
PreflightParser has this:
{code}
    public PreflightParser(DataSource dataSource) throws IOException
    {
        // TODO move file handling outside of the parser
        super(new RandomAccessBufferedFileInputStream(dataSource.getInputStream()));
        this.setLenient(false);
        this.originalDocument = dataSource;
    }
{code}
The TODO message looks like a design issue, but it is much worse: the RandomAccessBufferedFileInputStream is never closed, which results in the temp file not being deleted. The file parameter constructor has the same problem, i.e. that the RandomAccessBufferedFileInputStream object is not closed (no temp file there).

  was:
PreflightParser has this:
{code}
    public PreflightParser(DataSource dataSource) throws IOException
    {
        // TODO move file handling outside of the parser
        super(new RandomAccessBufferedFileInputStream(dataSource.getInputStream()));
        this.setLenient(false);
        this.originalDocument = dataSource;
    }
{code}
The TODO message looks like a design issue, but it is much worse: the RandomAccessBufferedFileInputStream is never closed. The file parameter constructor has the same problem.


> Memory leak in preflight
> ------------------------
>
>                 Key: PDFBOX-3008
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3008
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Preflight
>    Affects Versions: 2.0.0
>            Reporter: Tilman Hausherr
>
> PreflightParser has this:
> {code}
>     public PreflightParser(DataSource dataSource) throws IOException
>     {
>         // TODO move file handling outside of the parser
>         super(new RandomAccessBufferedFileInputStream(dataSource.getInputStream()));
>         this.setLenient(false);
>         this.originalDocument = dataSource;
>     }
> {code}
> The TODO message looks like a design issue, but it is much worse: the RandomAccessBufferedFileInputStream is never closed, which results in the temp file not being deleted. The file parameter constructor has the same problem, i.e. that the RandomAccessBufferedFileInputStream object is not closed (no temp file there).



--
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