I've added Deflater.end() just in case the GC is slow to call finalize(). You 
can get it from the SVN.

Paulo 

> -----Original Message-----
> From: Mallin, Eoin [mailto:[email protected]] 
> Sent: Tuesday, December 23, 2008 4:29 PM
> To: [email protected]
> Subject: [iText-questions] iText memory issue
> 
> 
> Hi,
> first of all thanks for you great product. I've used it in a number
> applications to date.
> 
> Recently we've come across an issue whereby our application 
> was exhausting
> all native memory when using iText. We're running the 
> application on Solaris
> 9 and our Java memory settings are -Xmx2048m -Xms 2048m. 
> After merging a few
> hundred PDFs we found that iText was using up at least 1.5GB of native
> memory. Ultimately our total process memory exceeded 4GB and caused
> OutOfMemory exceptions. After diagnosing the issue, I came across the
> following Sun bug that might have an impact on iText:
> 
> http://74.125.77.132/search?q=cache:8Dw3YomvnVAJ:bugs.sun.com/
> bugdatabase/vie
> w_bug.do%3Fbug_id%3D4797189+outofmemory+deflater&hl=en&ct=clnk
> &cd=1&gl=ie
> 
> After reviewing the bug it would appear that the
> com.lowagie.text.pdf.PdfStream could be susceptable to the 
> same issue. This
> class uses DeflaterOutputStream but never calls the end() 
> method on its
> Deflater object. Although the close() method is called on
> DeflaterOutputStream which in turn calls close() on its 
> Deflater object,
> because a Deflater is specfied in the constructor (new
> DeflaterOutputStream(stream, new 
> Deflater(compressionLevel));) the end()
> method never gets called.
> Our OutOfMemory error looks as follows:
> java.lang.OutOfMemoryError
>         at java.util.zip.Deflater.init(Native Method)
>         at java.util.zip.Deflater.<init>(Deflater.java:117)
>         at java.util.zip.Deflater.<init>(Deflater.java:126)
>         at 
> com.lowagie.text.pdf.PdfStream.flateCompress(Unknown Source)
>         at com.lowagie.text.pdf.PdfFormXObject.<init>(Unknown Source)
>         at 
> com.lowagie.text.pdf.PdfTemplate.getFormXObject(Unknown Source)
>         at 
> com.lowagie.text.pdf.PdfWriter.releaseTemplate(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.setField(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.setField(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.setFields(Unknown Source)
> 
> Is this something that has previously been raised with iText?
> 
> Many thanks,
> Eoin
> 
> 
> Eoin Mallin
> ______________________________________________________________
> Revenue On-Line Services
> Castle View
> Georges Street
> Dublin 2
> VPN: 35379


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to