You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/11/20 18:44:34 UTC

[jira] [Commented] (PDFBOX-2512) OutOfMemory while signing large documents

    [ https://issues.apache.org/jira/browse/PDFBOX-2512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14219650#comment-14219650 ] 

ASF subversion and git services commented on PDFBOX-2512:
---------------------------------------------------------

Commit 1640774 from [~tchojecki] in branch 'pdfbox/branches/1.8'
[ https://svn.apache.org/r1640774 ]

PDFBOX-2512: OutOfMemory while signing large documents
- 1. clean the objectpool while closing the document
- 2. pass a BufferedInputStream to the SignatureInteface / remove some code
- pass a scratchfile to the load method in the example 'CreateSignature'

> OutOfMemory while signing large documents
> -----------------------------------------
>
>                 Key: PDFBOX-2512
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2512
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing, Signing
>    Affects Versions: 1.8.7
>            Reporter: Thomas Chojecki
>            Assignee: Thomas Chojecki
>
> While working with large documents, we found some memory issues.
> 1. The method close() in the COSDocument, clones the objectpool and does not clean it properly. The cloning in getObjects() cause a OutOfMemory exception.
> 2.The COSWriter copy the whole pdf into the memory for signing and does not use BufferedInputStream for the FileInputStream which also has a big performance impact. (PDFBOX-1798)
> 3. The cloning of COSStreams cause a OutOfMemory exception
> I used the CreateSignature example with a about 150 MB big document from here:
> https://cdn-reichelt.de/bilder/downloads/reichelt_01-2015_DE_B_HQ.pdf
> Additionaly I add a RandomAccessFile to the PDDocument.load in the CreateSignature class.
> PDDocument doc = PDDocument.load(document,new RandomAccessFile(new File("d:\\temp.bin"), "rw")); (this prevent the OOM for the third case)
> The use of a BuffedInputStream in case two, will increase the signing speed from more than 5 minutes to less than 1 minute. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)