xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fleetwood, Brett (SSABSA)" <bre...@ssabsa.sa.gov.au>
Subject RE: using multiple page sequences
Date Wed, 17 Mar 2004 02:23:22 GMT
Fabrizio Thanks. Exactly what I needed. Previously the memory grew to about
330Mb over 3 minutes, now it hovers at about 13Mb for that duration. Its
interesting to see that the XSL-transformation (using XALAN) uses more
memory that the actual redoring (Using FOP). Getting FOP to do the whole
thing increases the usage to 35Mb.


> Simply plugging in a few memory cards isn't enough. Java has to know the
> size of the heap (free store) that it is allowed to create. For the Sun
> Java, use the commands: "java -j"  and "java -X" to see the options.

John, sorry to not explain myself, I had increaed the stack and heap sizes,
while this puts a band-aid on the problem it doesn't fix the underliing
issue, I looks like this is fixed now though using Fabrizio method. Thanks
all.

---
BRETT FLEETWOOD
Analyst/Programmer


-----Original Message-----
From: Fabrizio Tringali [mailto:fabtri@sda.it]
Sent: Friday, 12 March 2004 10:51 PM
To: fop-user@xml.apache.org
Subject: Re: using multiple page sequences


Hi Brett,

It's not about "faith", spanning datas across multiple page sequences 
brings an huge memory saving.
We solve issue of constant OutOfMemory errors (according to heap 
allocation) going to about 2 MB memory consumption on fully written 100 
pages documents.

You have to identify where in your document could be inserted a page break
or
decide to break intentionally after N rows of datas (1 record on your XML 
file can be M rows on document so M*N is the total rows on document)

In the second case put logic for break when ciclying your datas templates 
using something like this ($STOP is max number of data rows for page):

<xsl:for-each select="DATA_ROW[position() mod $STOP = 1]">
         <fo:page-sequence master-reference="YOUR_MASTER_REFERENCE" 
initial-page-number="auto">
                 <fo:flow flow-name="xsl-region-body">
                         <fo:table table-layout="fixed" width="480pt">
                             <fo:table-column column-width="85pt"/>
                             <fo:table-column column-width="15pt"/>
                             <fo:table-body>
                                 <fo:table-row line-height="30pt">
                                         <fo:table-cell>
                                                 <fo:block 
text-align="center" font-size="10pt" font-family="Courier">title
1</fo:block>
                                         </fo:table-cell>
                                         <fo:table-cell>
                                                 <fo:block 
text-align="center" font-size="10pt" font-family="Courier">title
2</fo:block>
                                         </fo:table-cell>
                                 </fo:table-row>
                            </fo:table-body>
                         </fo:table>
                         <xsl:for-each 
select=".|following-sibling::DATA_ROW[position() &lt; $STOP]">
                                 <xsl:apply-templates select="."/>
                         </xsl:for-each>
                 </fo:flow>
         </fo:page-sequence>
</xsl:for-each>

<xsl:template match="DATA_ROW">
         <fo:table table-layout="fixed" width="480pt">
                 <fo:table-column column-width="85pt"/>
                 <fo:table-column column-width="10pt"/>
                 <fo:table-body>
                         <fo:table-row line-height="13pt">
                                 <fo:table-cell>
                                         <fo:block text-align="left" 
font-size="10pt" font-family="Courier">
                                                 <xsl:value-of 
select="YOUR_ROW_KEY_1"/>
                                         </fo:block>
                                 </fo:table-cell>
                                 <fo:table-cell>
                                         <fo:block text-align="center" 
font-size="10pt" font-family="Courier">
                                                 <xsl:value-of 
select="YOUR_ROW_KEY_2"/>
                                         </fo:block>
                                 </fo:table-cell>
                         </fo:table-row>
                 </fo:table-body>
         </fo:table>
</xsl:template>

Hope this help
fabrizio


At 02.32 12/03/2004, you wrote:
>Hi all,
>
>I am having out of memory issues when transforming my FO -> PDF using
>fop-0.20.5rc2. I read that using multiple page sequences in the XSL and
>therefore in the FO means that fop will release some memory. I don't see
how
>I can do this. My XML file is generated dynamically from a database so I
>don't know how big it will be. Is there any solutions I can use that uses
>multiple page sequences or possible change the xml structure, if not is
>there another FOP transformer that isn't as memory intensive. Thanks in
>advanced for any help. If I havn't provided enough info please ask and I
can
>get back to you.

Defend your privacy! Encrypt your email today! 
http://www.bytefusion.com/secexmail 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message