Loading ...
Sorry, an error occurred while loading the content.

fo:external-graphic and OutOfMemoryError?

Expand Messages
  • A Vander
    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
    Message 1 of 2 , Sep 4, 2003
    • 0 Attachment
      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:block font-size="10pt">
      <fo:inline font-weight="bold">Scr. 9-2 : </fo:inline>...</fo:block>
      </fo:block>

      BTW I use fop 0.20.5rc2. Any suggestions on how to solve/avoid this memory problem would be appreciated. TIA.


      Avander


      ---------------------------------
      Do you Yahoo!?
      Yahoo! SiteBuilder - Free, easy-to-use web site design software

      [Non-text portions of this message have been removed]
    • Chris Bowditch
      ... ... so try -Xmx512M ... I believe graphics are held in a cache, which can be cleared using a reset method, see:
      Message 2 of 2 , Sep 5, 2003
      • 0 Attachment
        >From: A Vander <avander_be@...>

        <snip/>

        >
        >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...
        >

        so try -Xmx512M

        <snip/>

        >
        >BTW I use fop 0.20.5rc2. Any suggestions on how to solve/avoid this memory
        >problem would be appreciated. TIA.
        >
        >

        I believe graphics are held in a cache, which can be cleared using a reset
        method, see:

        http://xml.apache.org/fop/graphics.html#caching

        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
        cache.

        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.

        Chris

        _________________________________________________________________
        On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile
      Your message has been successfully submitted and would be delivered to recipients shortly.