Hi Dennis,

Make sure you die during pdf creation, not during transformation.
Keep your page-sequences as short as possible. Starting a new page-sequence 
releases memory used by previous page-sequence
If you have many images which are only used once, deactivate image cache.
This topic is fairly common in this list, so check the archive for details.

Regards,

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: Dennis van Zoerlandt [mailto:dvzoerla...@vanboxtel.nl]
Gesendet: Freitag, 25. März 2011 09:51
An: fop-users@xmlgraphics.apache.org
Betreff: OutOfMemoryException while transforming large XML to PDF


I get a OutOfMemoryException (Java heap space) while transforming a
relatively large XML (10 MB) with a XSL-FO to a PDF file. I'm using these
steps for the transformation:

---
FOUserAgent userAgent = fopFactory.newFOUserAgent();
Fop fop = this.fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslFile));
transformer.setParameter("versionParam", "2.0");
Source src = new StreamSource(xmlFile);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
---

I have tried to increase the initial and maximum heap size (with options
-Xms and -Xmx) at JVM startup but with no success. While transforming, I'm
monitoring the size of the used and maximum tenured generation memory pool.
The options don't seem to affect the tenured pool size: this pool is
continuously getting full in 3, 4 minutes which results shortly after that
in this exception.

What are my options to prevent the OutOfMemoryException?

Best regards,
Dennis van Zoerlandt
--
View this message in context: 
http://old.nabble.com/OutOfMemoryException-while-transforming-large-XML-to-PDF-tp31236044p31236044.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


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

Reply via email to