Clearing the cache won't help in this case. The problem is that your
images are probably all in the same page-sequence. Together with a "page
x of y" and the fact that ImageIO's JPEG codec copies the JPEG to a
local temp file for decoding I guess that could easily lead to 800 open
files.

Please try the following: Change org.apache.fop.image.ImageFactory
(around line 94) like this:

current:
        imt = new ImageMimeType("image/jpeg");
        imageMimeTypes.put(imt.getMimeType(), imt);
        imt.addProvider(jpegImageIOImage);
        imt.addProvider(jpegImage);

change to:
        imt = new ImageMimeType("image/jpeg");
        imageMimeTypes.put(imt.getMimeType(), imt);
        imt.addProvider(jpegImage);
        imt.addProvider(jpegImageIOImage);

(i.e. switch the two lines with "addProvider" so the "jpegImage" comes
before "jpegImageIOImage"). Since you're generating PDF you don't need
the ImageIO variant (i.e. an actual JPEG codec). Using the other JPEG
provider will not create any temp files and should therefore solve your
problem. No guarantees, though.

Of course, you'll need to recompile FOP after the change. Let us know if
it helps.

PS: Please don't cross-post to all mailing lists when asking a question.
It's fully sufficient to just post to [EMAIL PROTECTED]
I've only moderated through the message to fop-users.

On 14.06.2007 23:27:23 Moses, John {PBSG} wrote:
> Hi,
>         
> I have an application that uses FOP 0.93 to render JPEG Images in a PDF
> document. Each of these Images are unique for a document and never
> reused within the same PDF.
> 
> I create a PDF of these images roughly 800 images in a PDF. Everytime I
> generate this PDF, I end up adding 800 more images in my temp
> directory(.tmp files).
> 
> My problem now is, as these temp files grow and reach the per process
> limit of Weblogic, weblogic can't create any more cache file and
> eventually stops listening to my port(error is 'Too many open files'
> <BEA-110017>)
> 
> I would like to know how I can clear the image cache. I tried using
> getImageFactory().clearCaches() of my FopFactory instance and still
> doesn't clear the tmp files.
> 
> Appreciate any pointers with this.
>         
> Regards
> John Moses



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to