Hello,

as is well-known, FOP can run out of heap memory, when large documents
are processed (http://xmlgraphics.apache.org/fop/0.95/running.html#memory).

I have the situation that the documents I have to process mandate a footer on 
each page that contains a "page X of Y" element and a TOC at the
beginning of the document, i.e. FOP cannot layout the pages until all
referenced page-citations are known, which is after the last page of the 
document.

When page content is quite complicated (e.g. 2000 pages mostly full with 
tables), the heap space does not suffice to hold all pages until all references 
can be resolved, thus FOP aborts with out-of-memory.

Since increasing the heap space does not always work (3 GB heap space was 
required in one example), I need a better solution for this.

1. "-conserve" option
One alternative would be the "-conserve" option, which serializes the pages to 
disk and reloads them as needed.
Although slow, this definitely would be a solution, if it worked, which it 
doesn't:
 Our documents include graphics (SVG, PNG), and the serialization with 
"-conserve" throws an exception, because some class in Batik is not 
serializable (e.g. "SVGOMAnimatedString" IIRR), thus the page is missing, 
causing FOP to abort later.
Thus, Batik would have to be fixed for this.

2. Two passes
Since the pages are kept because of unresolved references, one could do the
same as e.g. LaTeX always did: process the document twice.
In a first run, pages are discarded after layout, only the references for 
page-citations are kept and at the end reused for the second pass
(when all pages for the citations are finally known).
For the second run, these id-refs are initially loaded and no pages have
to be kept.
This would require more changes in FOP (and should definitely be made optional 
obviously).



I would appreciate any comments or other suggestions !


Best regards
  Stephan
-- 
Dr.-Ing. Stephan Thesing
Elektrastr. 50
81925 M√ľnchen
GERMANY

Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser

Reply via email to