fo:external-graphic and OutOfMemoryError?
- Hi all,
This is my first post to this newsgroup though I'm not new to FOP.
Recently I encountered a memory problem when generating PDF's using FOP. The intermediate fo file contains about a hundred fo:external-graphic elements and made FOP crash with an OutOfMemoryError exception.
I searched the newsgroup before posting and used the commandline parameter
-Xmx128M with succes. The bad news is that the final fo:file will contain at least 300 fo:external-graphic elements, so this problem is likely to reappear...
In this context the external-graphic element refers to monochrome screenshots in PNG format. This is the sequence I use for every screenshot, it seems ok to me, maybe I overlooked something :
<fo:block font-size="12pt" font-family="Times-Roman" space-after.optimum="10pt">
<fo:block><fo:external-graphic src="file:/eDoc/ana/nl/screenshots/USCR01b.png" /></fo:block>
<fo:inline font-weight="bold">Scr. 9-2 : </fo:inline>...</fo:block>
BTW I use fop 0.20.5rc2. Any suggestions on how to solve/avoid this memory problem would be appreciated. TIA.
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
[Non-text portions of this message have been removed]
>From: A Vander <avander_be@...><snip/>
>so try -Xmx512M
>I searched the newsgroup before posting and used the commandline parameter
>-Xmx128M with succes. The bad news is that the final fo:file will contain
>at least 300 fo:external-graphic elements, so this problem is likely to
>I believe graphics are held in a cache, which can be cleared using a reset
>BTW I use fop 0.20.5rc2. Any suggestions on how to solve/avoid this memory
>problem would be appreciated. TIA.
However, you will only be able to clear that at the end of the document, not
during processing. Some of the other tricks for reducing memory usage,
include breaking up your document into multiple fo:page-sequences. However,
I dont believe that will help here, because the graphics are kept in this
So unless I've missed something, your only choice is to increase -Xmx to a
value that wont be exceeded with 300 graphics in a single document.
On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile