> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Wahaj
> Sent: Monday, January 17, 2005 1:53 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Re: Re: signing 10 MB sized pdf document
> 
> In most of the cases it keeps on taking more memory until Out 
> Of Memory

Most of the cases? It either leaks or not.

> error is shown. I have also tested encryption of pdf document 
> and the memory
> utilization is lower than while signing but it still grows. 
> Is there a way
> to resolve this issue ?

I don't have any issue. I've just finished signing 1000 docs, each 10M
in size without any problem. I used this code:

for (int k = 0; k < 1000; ++k) {
    KeyStore ks = KeyStore.getInstance("pkcs12");
    ks.load(new FileInputStream("c:\\certvery2.pfx"),
"password".toCharArray());
    String alias = (String)ks.aliases().nextElement();
    PrivateKey key = (PrivateKey)ks.getKey(alias,
"password".toCharArray());
    Certificate[] chain = ks.getCertificateChain(alias);
    PdfReader reader = new PdfReader("c:\\smith.pdf");
    FileOutputStream fout = new FileOutputStream("c:\\smith_sig.pdf");
    PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
    PdfSignatureAppearance sap = stp.getSignatureAppearance();
    sap.setCrypto(key, chain, null,
PdfSignatureAppearance.VERISIGN_SIGNED);
    sap.setReason("I'm the author");
    sap.setLocation("Lisbon");
    sap.setVisibleSignature(new Rectangle(100, 100, 300, 200), 1, null);
    stp.close();
    System.out.println("Sign " + k + " Mem " +
Runtime.getRuntime().freeMemory());
}

Using Sun's jdk in windows 1.4.2_05b with -mx128m.

Unless you produce code and a pdf so that I can reproduce the problem I
believe the case is closed.

> 
> Regards,
> Wahaj
> 
> "Paulo Soares" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> What happens if you sign many 10M docs in a row?
> 
> > -----Original Message-----
> > From: Wahaj [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 14, 2005 2:56 PM
> > To: Paulo Soares; itext-questions@lists.sourceforge.net
> > Subject: Re: [iText-questions] Re: signing 10 MB sized pdf document
> >
> > Yeah even after an explicit gc( ).
> >
> > Yes it comes down but a bit I mean i tried to sign a 10 MB
> > file where the
> > application took 20 MB RAM at the start and then the
> > application took 120
> > MB  and then dropped to 95. It should have came down to 20 MB.
> >
> > Regards,
> > Wahaj
> >
> > ----- Original Message ----- 
> > From: "Paulo Soares" <[EMAIL PROTECTED]>
> > To: "Wahaj" <[EMAIL PROTECTED]>;
> > <itext-questions@lists.sourceforge.net>
> > Sent: Friday, January 14, 2005 7:44 PM
> > Subject: RE: [iText-questions] Re: signing 10 MB sized pdf document
> >
> >
> > > Even after an explicit gc()?
> > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On
> > > > Behalf Of Wahaj
> > > > Sent: Friday, January 14, 2005 1:04 PM
> > > > To: itext-questions@lists.sourceforge.net
> > > > Subject: [iText-questions] Re: signing 10 MB sized pdf document
> > > >
> > > > Hi Paulo,
> > > >
> > > > I have an observation regarding iText. After the signing
> > > > process is complete
> > > > the application don't release the amount of memory which was
> > > > used in the
> > > > signing of the pdf
> > > >
> > > > Example:
> > > > When the Java application was launched the system memory was
> > > > at 100 MB, when
> > > > signing process just have to start the system memory is at
> > > > 105 MB, after the
> > > > signing process is compeleted the memory goes to 120MB. Now
> > > > it seems that it
> > > > took 20MB for iText to sign the PDF document (This may vary
> > > > depending upon
> > > > the size of the PDF document which is fine keeping in view
> > > > that iText loads
> > > > the compelete PDF in one go). Question is that after the
> > > > signing is done the
> > > > memory stays at 120MB. It might come down to 119 MB but don't
> > > > come back to
> > > > 105 MB. It seems that iText is not releasing the memory it
> > > > took to sign the
> > > > pdf why is that ?
> > > >
> > > > Regards,
> > > > Wahaj
> > > >
> > > > "Paulo Soares" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]
> > > > 100M looks too much but reading a pdf requires memory. One
> > > > day PdfReader
> > > > will work incrementally but until then...
> > > >
> > > > > -----Original Message-----
> > > > > From: [EMAIL PROTECTED]
> > > > > [mailto:[EMAIL PROTECTED] On
> > > > > Behalf Of Wahaj
> > > > > Sent: Tuesday, January 11, 2005 6:16 AM
> > > > > To: itext-questions@lists.sourceforge.net
> > > > > Subject: [iText-questions] signing 10 MB sized pdf document
> > > > >
> > > > > Hi All,
> > > > >
> > > > > I am trying to digitally sign a 10 MB pdf document and
> > > > > getting out of memory
> > > > > exceptions using iText samples [it took more than 100 MB for
> > > > > the sample]. I
> > > > > know how to increase the heap size to remove this problem but
> > > > > I was thinking
> > > > > whether some effective memory management can be made in iText
> > > > > like streaming
> > > > > of some sort which donot take much memory while signing.
> > > > > Think about signing
> > > > > a 20 MB+ pdf document which would really eat up system's
> > > > > memory. Is there a
> > > > > way ?
> > > > >
> > > > > Regards,
> > > > > Wahaj
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > The SF.Net email is sponsored by: Beat the post-holiday blues
> > > > > Get a FREE limited edition SourceForge.net t-shirt from
> > ThinkGeek.
> > > > > It's fun and FREE -- well,
> > > > almost....http://www.thinkgeek.com/sfshirt
> > > > > _______________________________________________
> > > > > iText-questions mailing list
> > > > > iText-questions@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > The SF.Net email is sponsored by: Beat the post-holiday blues
> > > > Get a FREE limited edition SourceForge.net t-shirt from 
> ThinkGeek.
> > > > It's fun and FREE -- well,
> > almost....http://www.thinkgeek.com/sfshirt
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > The SF.Net email is sponsored by: Beat the post-holiday blues
> > > > Get a FREE limited edition SourceForge.net t-shirt from 
> ThinkGeek.
> > > > It's fun and FREE -- well,
> > almost....http://www.thinkgeek.com/sfshirt
> > > > _______________________________________________
> > > > iText-questions mailing list
> > > > iText-questions@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > > >
> > >
> >
> >
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> 
> 
> 
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to