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