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

Maruan Sahyoun commented on PDFBOX-5068:
----------------------------------------

[~rol.bo] Did some quick JMH tests using CreateVisibleSignature2 and the 20MB 
file you mentioned like so

{code:java}
CreateVisibleSignature2 signing = new CreateVisibleSignature2(myState.keyStore, 
PASSWORD.toCharArray());
Rectangle2D humanRect = new Rectangle2D.Float(100, 200, 150, 50);
signing.setImageFile(new File(JPEG_PATH));
signing.setExternalSigning(false);
destFile = new File("signed_visible2.pdf");
signing.signPDF(new File("506-42-86246-2-10-20190822.pdf"), destFile, 
humanRect, null);
{code}

Results are

3.0.0-RC1
{code}
Benchmark                                    Mode  Cnt     Score     Error  
Units
PDFBoxBenchmark.testCreateVisibleSignature2  avgt   25  7657,591 ± 312,315  
ms/op
{code}

3.0.0-alpha2
{code}
Benchmark                                    Mode  Cnt     Score     Error  
Units
PDFBoxBenchmark.testCreateVisibleSignature2  avgt   25  7141,029 ± 226,022  
ms/op
{code}

Could you verify if you get similar numbers? Will try with trunk shortly.
  

> OutOfMemory while signing large documents - continued
> -----------------------------------------------------
>
>                 Key: PDFBOX-5068
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5068
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Signing
>    Affects Versions: 2.0.23
>            Reporter: Ralf Hauser
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>         Attachments: RandomAccessReadBufferDiag.java, issue5068.patch, 
> minimum.pdf
>
>
> Continuation of PDFBOX-2512
>  
> in COSWriter.prepareIncrement(), for the test case 
> cosDoc.getXrefTable().keySet() has size 5925. For each of thes keys, 
> cosDoc.getObjectFromPool() gets an object that is not just referencing some 
> part of the input document, but duplicates it (which is unavoidable in the 
> case where they are decompressed with FlateFilter - albeit this could 
> possibly be done "lazy")
> -Xmx20m  746/5925
>  -Xmx25m 1615/5925
>  -Xmx30m 2800/5925
>  -Xmx40m 3872/5925
>  -Xmx55m 5773/5925
> With 60m, it gets them all, but dies later with less telling
>    java.lang.OutOfMemoryError: GC overhead limit exceeded
>  
> This assumes the patch of PDFBOX-5067 already in place - or using 
> CreateVisibleSignature2.java as starting point



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to