Actually I am looping (not in the example) through a number of Pdf files (currentPdfFile) and after adding the Imported Page to the PdfCopy I am setting the pdfReader object to null (not in the example), so I am expecting this object to be garbage collected a any time during the process.
Thanks for your help,
Elvis Novas
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: [iText-questions] PDFReader doesn't Garbage Collect
> Date: Thu, 27 Apr 2006 21:20:42 +0100
>
> When did you expect PdfReader to be garbage collected? In your code it's
> used up to end.
>
> Paulo
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, April 27, 2006 4:57 PM
> Subject: [iText-questions] PDFReader doesn't Garbage Collect
>
>
> Hi All,
>
>
>
> I'm generating a Book (PDF file) using Java. The book is made of several
> existent pdf files (mostly images) as pages and when this book reaches a
> significant amount of MBs I'm running out memory. Checking the process
> using OptimizeIt in JBuilder I'm noticing that PDFReader is not "garbage
> collecting" this object causing the application to hang because of the
> memory problem. If Increase the memory I'm able to finish the process
> but I don't think that should be the solution since we consider that
> what the JVM has now is good enough. By the way, the size of the last
> book (it varies based on different business needs) 96 MB.
>
>
>
> The following is the approach I taking (not actual code):
>
> Document mainDocument = new Document(PageSize.LETTER, 36, 36, 36, 36);
>
> FileOutputStream book = new FileOutputStream(outputFile);
>
> PdfCopy pdfCopy = new PdfCopy(mainDocument, book);
>
> mainDocument.open();
>
>
>
> PdfReader pdfReader = new PdfReader(currentPdfFile); ====>
> here's where OptimizeIt is showing the memory leak.
>
> PdfImportedPage importedPage =
> pdfCopy.getImportedPage(pdfReader, 1);
>
> pdfCopy.addPage(importedPage);
>
>
>
> mainDocument.close();
>
>
>
>
>
> TIA,
>
>
>
> Elvis Novas
>
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
