I suppose you are converting tiff to pdf and not the other way around.
Check that your code is something like this:

RandomAccessFileOrArray ra = null;
try {
    ra = new RandomAccessFileOrArray(imgb);
    Image img = TiffImage.getTiffImage(ra, 1);
    return img;
} finally {
    if (ra != null)
        ra.close();
}

It will make sure that the file is closed if some exception is throwned.


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of John Pruitt
> Sent: Tuesday, December 20, 2005 3:15 PM
> To: [email protected]
> Subject: [iText-questions] Possible File Resource Leak
> 
> I have a program that basically batch converts pdfs to 
> multi-page tiffs 
> using iText. I am running into a problem. In my testing, I had the 
> program batch convert 12,000 pdf files to multi-page tiff. 
> The program 
> worked like a charm for 8 hours, then it hit an exception: 
> "To many open 
> files." The program logged the exception and continued for 8 
> more hours 
> before hitting the same exception again. After that, the 
> exception came 
> more frequently, every 2 hours or so.
> I have checked my code, and am closing file streams as I finish with 
> them. I was wondering how likely it is that iText may not be properly 
> releasing resources, and where I should look in the code to see.
> Thank you,
> John Pruitt
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to