Hi Georg,

Now I understand. Is it correct to say that during the
transformer.transform() method both the transformation as well as the PDF
creation is being performed? If not, which part of my code performs the
creation of the PDF?

Hereby the debug logging before the Exception is thrown:

---
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) BlockLayoutManager:
org.apache.fop.layoutmgr.BlockLayoutManager@35e6e3[fobj=org.apache.fop.fo.flow.Block@be76c7[@id=]]:
Border Rel
Side:after -> MinOptMax[min = 566, opt = 566, max = 566]
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) BlockLayoutManager:
org.apache.fop.layoutmgr.BlockLayoutManager@c9630a[fobj=org.apache.fop.fo.flow.Block@115126e[@id=]]:
Space Rel
Side:before, null-> MinOptMax[min = 14173, opt = 14173, max = 14173]
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) AbstractBreaker: PLM>
part: 1, start at pos 0, break at pos 3, break class = ANY
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) AbstractBreaker:     
addAreas from 0 to 0
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) IDTracker:
signalIDProcessed()
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG)
AbstractPageSequenceLayoutManager: page finished: 26, current num: 26
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) AreaTreeHandler: Last
page-sequence produced 2 pages.
[2011-03-25 13:58:24 thread-fileprinter1] (DEBUG) PageSequenceLayoutManager:
Ending layout
---

And the first part of the stack trace:
---
[2011-03-25 14:02:56] java.lang.OutOfMemoryError: Java heap space
        at org.apache.fop.fo.FOText.charIterator(FOText.java:223)
        at
org.apache.fop.fo.RecursiveCharIterator.getNextCharIter(RecursiveCharIterator.java:104)
        at
org.apache.fop.fo.RecursiveCharIterator.<init>(RecursiveCharIterator.java:62)
        at
org.apache.fop.fo.XMLWhiteSpaceHandler.handleWhiteSpace(XMLWhiteSpaceHandler.java:157)
        at
org.apache.fop.fo.FObjMixed.handleWhiteSpaceFor(FObjMixed.java:87)
        at org.apache.fop.fo.FObjMixed.finalizeNode(FObjMixed.java:176)
        at org.apache.fop.fo.FONode.endOfNode(FONode.java:326)
        at org.apache.fop.fo.FObjMixed.endOfNode(FObjMixed.java:69)
        at org.apache.fop.fo.flow.Block.endOfNode(Block.java:148)
        at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
        at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
        at
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(Unknown
Source)
        at
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(Unknown
Source)
---

It's notable that between the last debug message (13:58:24) and the
exception message (14:02:56) there is more than 3 minutes of no logging. The
only thing I see is that the tenured generation memory pool is being filled.
In less than a minute from the last debug message the full tenured memory is
full. Still, it takes until 14:02:56 to throw an OutOfMemory exception.

I tried your VM settings, but unfortunately without success.

Best regards,
Dennis van Zoerlandt


Georg Datterl wrote:
> 
> Hi Dennis,
> 
> There are two steps: XML+XSLT-> FO that's the transformation. Done by
> saxon or xerces, usually. Anyway, not the main concern on this list.
> FO->PDF that’s the creation. That's FOPs part and the main concern here.
> If your process dies during the first step, there's no use in giving you
> hints how to reduce memory consumption in the second step, obviously. If
> you are not sure, you could post the last few lines of debug output before
> the Exception appears. Maybe that can give a hint.
> As for the JVM settings: I create my larger PDFs with -Xmx2000m -Xincgc
> 
> 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 10:28
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: AW: OutOfMemoryException while transforming large XML to PDF
> 
> 
> Hi Georg,
> 
> As far as I'm understanding it, the transformation is the PDF creation?
> 
> The image cache is already cleared after each converted file.
> 
> I'll search the list archive for other options. I was hoping for certain
> JVM
> settings which could increase the tenured memory pool size.
> 
> Best regards,
> Dennis van Zoerlandt
> 
> 
> Georg Datterl wrote:
>>
>> 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
>>
>>
>>
> 
> --
> View this message in context:
> http://old.nabble.com/OutOfMemoryException-while-transforming-large-XML-to-PDF-tp31236044p31236224.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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/OutOfMemoryException-while-transforming-large-XML-to-PDF-tp31236044p31237755.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

Reply via email to