You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2009/10/01 09:20:12 UTC

Re: Too many open images?

You're doing catalogs, right? Tons of pictures? Currently, the image
loading framework tries to reuse recently opened streams after image
preloading (loading the image extents) for the actual image loading to
avoid additional network round-trips. With very image-intensive
documents the number of opened streams can get too high which causes
what you see.

You can disable stream reuse by setting a system property:
-Dorg.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.no-source-reuse=true

See also:
http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java?view=markup

On 29.09.2009 16:34:23 Georg Datterl wrote:
> Hi everybody,
> 
> Today I don't have a fo file for a riddle, but a question nonetheless.
> In my application I do stuff, generate a fo file and then generate a
> PDF. Then I do stuff again. While doing this second stuff I get IO Exceptions
> (Too many open files) and when generating the PDF I get lots of "Image
> not found...". I'm closing all streams in my first "do stuff" part and
> now I wonder whether FOP is keeping the external image file handles
> alive when generating the PDF. I thought, maybe the images are cached
> and the file handles run out before memory runs out and the garbage
> collector can throw away the images. Is that possible? If yes, how
> could that be avoided?
> 
> Regards,
>  
> Georg Datterl

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: Too many open images?

Posted by Georg Datterl <ge...@geneon.de>.
Hi Jeremias, 

Thanks, that works now. 

I assume "//TODO Temporary measure to track down a problem" can be translated to "Use it, it will stay forever"? ;-)

Mit freundlichen Grüßen
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Gesendet: Donnerstag, 1. Oktober 2009 09:20
An: fop-users@xmlgraphics.apache.org
Betreff: Re: Too many open images?

You're doing catalogs, right? Tons of pictures? Currently, the image loading framework tries to reuse recently opened streams after image preloading (loading the image extents) for the actual image loading to avoid additional network round-trips. With very image-intensive documents the number of opened streams can get too high which causes what you see.

You can disable stream reuse by setting a system property:
-Dorg.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.no-source-reuse=true

See also:
http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java?view=markup

On 29.09.2009 16:34:23 Georg Datterl wrote:
> Hi everybody,
> 
> Today I don't have a fo file for a riddle, but a question nonetheless.
> In my application I do stuff, generate a fo file and then generate a 
> PDF. Then I do stuff again. While doing this second stuff I get IO 
> Exceptions (Too many open files) and when generating the PDF I get 
> lots of "Image not found...". I'm closing all streams in my first "do 
> stuff" part and now I wonder whether FOP is keeping the external image 
> file handles alive when generating the PDF. I thought, maybe the 
> images are cached and the file handles run out before memory runs out 
> and the garbage collector can throw away the images. Is that possible? 
> If yes, how could that be avoided?
> 
> Regards,
>  
> Georg Datterl

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org