You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Nige White <ni...@forward-comp.co.uk> on 2006/02/07 13:54:23 UTC

java.lang.OutOfMemoryError processing fairly large table to PDF

I have a FOP document which is being generated by an XML transformation 
from CSV.

I have a SAX parser which reads CSV, and fires events to make it look 
like an XML document. This is processed into FO XML by an XSL 
transformation.

Now the particular data I have is test data, and is quite large with a 
lot of columns (They're user selected, so I selected all available just 
to squeeze out this kind of problem!). This means that the table is very 
wide.

In order to fit it into A4, the XSL transformation does a bit of testing 
on the width, first setting orientation to landscape, and then if it 
still doesn't fit, it scales down the font it uses (It's coded to use 
Arial) from 10 points to whatever's necessary. This case is unrealistic 
because there are so many columns, it has to go down to a font size of 
2.48 points, *but it should still create the PDF* - you'd just have to 
scale it up in Acrobat to read it!!!!

The problem is, that FOP is blowing up with an "Out of memory" exception.

I'm not asking it to process *that much* data. It should really be able 
to process a table with 37 columns and 386 rows (including the header)!

Here is the FO with all the table rows except the header, and first line 
of data removed. If you process that into PDF, it works OK.

The real data basically just goes on in the same vein the way data tends 
to, so to test it, just copy the table data row, and paste it in 385 
times. Why does it blow up, I'm not doing anything wrong am I? Not 
creating forward references like "Page n of n"?

HEEEEEELLLPPP!

Thanks,

Nige

<?xml version="1.0" encoding="UTF-8"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
   <fo:simple-page-master master-name="repeating" margin-top="1cm" 
margin-bottom="1cm" margin-left="1cm" margin-right="1cm" 
page-width="29.7cm" page-height="21cm">
     <fo:region-body margin-bottom="0.75cm" margin-top="1.25cm" 
margin-left="0cm"/>
     <fo:region-before extent="1.25cm"/>
     <fo:region-after extent="0.75cm"/>
   </fo:simple-page-master>
   <fo:page-sequence-master master-name="repeating_pm">
     <fo:repeatable-page-master-reference maximum-repeats="no-limit" 
master-reference="repeating"/>
     <fo:single-page-master-reference master-reference="repeating"/>
   </fo:page-sequence-master>
 </fo:layout-master-set>
 <fo:page-sequence initial-page-number="1" master-reference="repeating_pm">
   <fo:static-content flow-name="xsl-region-before">
     <fo:block space-after="1mm" font-weight="bold" 
text-decoration="underline" font-size="15pt" 
text-align="center">Purchase Order Report</fo:block>
     <fo:block space-after="5mm" font-weight="normal" font-size="10pt" 
text-align="center">Generated by ForwardOffice on 07-Feb-2006</fo:block>
   </fo:static-content>
   <fo:static-content flow-name="xsl-region-after">
     <fo:block line-height="14pt" font-family="sans-serif" 
font-size="10pt" space-before="2.5mm" text-align="center">Page
       <fo:page-number/>
     </fo:block>
   </fo:static-content>
   <fo:flow flow-name="xsl-region-body">
     <fo:block font-size="2.48pt">
       <fo:table border-collapse="collapse" table-layout="fixed" 
width="775.69pt">
         <fo:table-column column-width="24.87pt"/>
         <fo:table-column column-width="13.43pt"/>
         <fo:table-column column-width="17.91pt"/>
         <fo:table-column column-width="12.93pt"/>
         <fo:table-column column-width="18.40pt"/>
         <fo:table-column column-width="49.75pt"/>
         <fo:table-column column-width="11.44pt"/>
         <fo:table-column column-width="17.16pt"/>
         <fo:table-column column-width="17.16pt"/>
         <fo:table-column column-width="20.89pt"/>
         <fo:table-column column-width="13.93pt"/>
         <fo:table-column column-width="19.90pt"/>
         <fo:table-column column-width="18.40pt"/>
         <fo:table-column column-width="07.96pt"/>
         <fo:table-column column-width="16.17pt"/>
         <fo:table-column column-width="8.45pt"/>
         <fo:table-column column-width="26.86pt"/>
         <fo:table-column column-width="41.29pt"/>
         <fo:table-column column-width="21.89pt"/>
         <fo:table-column column-width="22.63pt"/>
         <fo:table-column column-width="18.40pt"/>
         <fo:table-column column-width="30.59pt"/>
         <fo:table-column column-width="34.82pt"/>
         <fo:table-column column-width="37.56pt"/>
         <fo:table-column column-width="34.58pt"/>
         <fo:table-column column-width="24.13pt"/>
         <fo:table-column column-width="17.66pt"/>
         <fo:table-column column-width="22.88pt"/>
         <fo:table-column column-width="18.40pt"/>
         <fo:table-column column-width="11.19pt"/>
         <fo:table-column column-width="9.70pt"/>
         <fo:table-column column-width="20.89pt"/>
         <fo:table-column column-width="20.89pt"/>
         <fo:table-column column-width="17.91pt"/>
         <fo:table-column column-width="17.91pt"/>
         <fo:table-column column-width="17.66pt"/>
         <fo:table-column column-width="18.90pt"/>
         <fo:table-header background-color="#A3C9F1">
           <fo:table-row>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Order 
Number</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Delivery</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Issue 
Date</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Currency</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Order 
Value</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Supplier 
Name</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Country</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Freight 
Cost</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Other 
Costs</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Demurrage/Ren</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">GOH 
Sets</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Carton 
Type</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Gross 
Weight</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">POL</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Volume 
m3</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">POD</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Vessel/Flight</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Carrier 
Name</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">B/Lading/MAWB</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Consignment Ref</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Entry 
Number</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Place of 
Delivery</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Product 
Code</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Product 
Short Name</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Class 
Description</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Colour</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Cost Per 
Unit</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Commodity Code</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Total 
Value</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Cartons</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Units</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Range/Look</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Style</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Ex-Factory</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">ETA 
UK</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" 
font-weight="bold">Cleared</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="center" font-weight="bold">Proof 
Delivery</fo:block>
             </fo:table-cell>
           </fo:table-row>
         </fo:table-header>
         <fo:table-body>
           <fo:table-row background-color="#E2ECF8">
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt">1</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt">2</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-left="4pt">01-Jul-2004</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" margin-right="4pt">0</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" 
margin-right="4pt">0.00</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" margin-right="4pt">0</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="right" margin-right="4pt">0</fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"/>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"></fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"></fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"></fo:block>
             </fo:table-cell>
             <fo:table-cell border="1pt solid lightgrey">
               <fo:block text-align="left" margin-left="4pt"></fo:block>
             </fo:table-cell>
           </fo:table-row>
         </fo:table-body>
       </fo:table>
     </fo:block>
   </fo:flow>
 </fo:page-sequence>
</fo:root>


_____________________________________________________________________
This message has been checked for all known viruses. Virus scanning
powered by Messagelabs http://www.messagelabs.com For more information
e-mail : hostmaster@forward-comp.co.uk


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


Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Chris Bowditch <bo...@hotmail.com>.
Nige White wrote:

<snip/>

> The problem is, that FOP is blowing up with an "Out of memory" exception.

OK. Looks like you have missed out the most important piece of 
information here. What version of FOP do you use?

> 
> I'm not asking it to process *that much* data. It should really be able 
> to process a table with 37 columns and 386 rows (including the header)!

Tables are expensive in terms of memory. It's true that your table isnt 
that big, but then the default Java Heap size is very small, i.e. 64Mb. 
If you try increasing it to 256Mb, does your document run through?

<snip/>

Chris



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


Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 08.02.2006 12:40:00 Nige White wrote:
> Louis.Masters@log-net.com wrote:
> 
> >
> > Nige:
> >
> > I can get 8 pages of your PO to render into PDF (around 900 rows I 
> > think), but only by increasing my JVM memory to a 400M.  It may be 
> > lower, but 400 is all I tested.
> >
> > My env is as follows:
> >
> > FOP 0.20.3
> > JDK 1.4.1
> > Win2K
> > Command line:  java -Xmx400M org.apache.fop.apps.Fop -fo nigehelp.fo 
> > -pdf nigehelp.pdf
> >
> > I can send you the PDF if you want?
> >
> So, is it just not possible to output a very large FOP table without it 
> buffering the whole thing up in memory?

Not at the moment, no.

> It doesn't make sense. Given that the table layout is fixed, it doesn't 
> need to see all the data before rendering, it should stream data out as 
> soon as it's ready. 

Right. But FOP 0.91/Trunk can't do that at the moment. Currently, the
page breaking always runs over a whole page-sequence (or until a hard
break or span change). Only after a page-sequence is finished will the
memory be released. Help on improving the current state is always
welcome. :-)

> Is there some other way I could display a large grid 
> of data?

If you ask me, you're using the wrong tool for your task. Not primarily
because FOP has limitations but also because XSL-FO is just overkill for
your particular use case. I'd investigate JasperReports or any other
reporting engine. These tools are much better suited to handle large
volumes of tabular data.

Jeremias Maerki


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


Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Lo...@log-net.com.
Nige:

Memory utilization is a big discussion point in these newsgroups and there 
have been many suggestions posted here.  Since I am on an older copy of 
FOP, I am hoping the rewrite helps out a bit with memory use (since you 
are using the rewrite and running into issues I am a bit nervous about it) 
and I really can not recommend anyhting until I upgrade.  In my production 
environment, the machines have a Gig or two or RAM, we can usually output 
docs with several hundred pages before we start running into resource 
issues.  The biggest improvement that I have seen to date is the use of 
multiple page sequences.  This practice saves us roughly 1/3 memory almost 
across the board.  It does have its side affects in that each page 
sequence break causes a page break and the resulting report can look a bit 
off.

With that said, the only other observation I have is that your table did 
put a big load on my system for the relatively small amount of data being 
rendered.  Try running it with debugging and see if any messages clue you 
in on a problem.  Also, you can try breaking up the table into multiple 
smaller ones to see if it helps.

-Lou

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content, 
the information contained herein is privileged and confidential 
information/work product. The communication is intended for the use of the 
individual or entity named above.  If the reader of this transmission is 
not the intended recipient, you are  hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please 
notify the sender immediately by telephone (732-758-6800) or by electronic 
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper 
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Nige White <ni...@forward-comp.co.uk> wrote on 02/08/2006 06:40:00 AM:

> Louis.Masters@log-net.com wrote:
> 
> >
> > Nige:
> >
> > I can get 8 pages of your PO to render into PDF (around 900 rows I 
> > think), but only by increasing my JVM memory to a 400M.  It may be 
> > lower, but 400 is all I tested.
> >
> > My env is as follows:
> >
> > FOP 0.20.3
> > JDK 1.4.1
> > Win2K
> > Command line:  java -Xmx400M org.apache.fop.apps.Fop -fo nigehelp.fo 
> > -pdf nigehelp.pdf
> >
> > I can send you the PDF if you want?
> >
> So, is it just not possible to output a very large FOP table without it 
> buffering the whole thing up in memory?
> 
> It doesn't make sense. Given that the table layout is fixed, it doesn't 
> need to see all the data before rendering, it should stream data out as 
> soon as it's ready. Is there some other way I could display a large grid 

> of data?
> 
> Nige
> 
> _____________________________________________________________________
> This message has been checked for all known viruses. Virus scanning
> powered by Messagelabs http://www.messagelabs.com For more information
> e-mail : hostmaster@forward-comp.co.uk
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 

Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Nige White <ni...@forward-comp.co.uk>.
Louis.Masters@log-net.com wrote:

>
> Nige:
>
> I can get 8 pages of your PO to render into PDF (around 900 rows I 
> think), but only by increasing my JVM memory to a 400M.  It may be 
> lower, but 400 is all I tested.
>
> My env is as follows:
>
> FOP 0.20.3
> JDK 1.4.1
> Win2K
> Command line:  java -Xmx400M org.apache.fop.apps.Fop -fo nigehelp.fo 
> -pdf nigehelp.pdf
>
> I can send you the PDF if you want?
>
So, is it just not possible to output a very large FOP table without it 
buffering the whole thing up in memory?

It doesn't make sense. Given that the table layout is fixed, it doesn't 
need to see all the data before rendering, it should stream data out as 
soon as it's ready. Is there some other way I could display a large grid 
of data?

Nige

_____________________________________________________________________
This message has been checked for all known viruses. Virus scanning
powered by Messagelabs http://www.messagelabs.com For more information
e-mail : hostmaster@forward-comp.co.uk


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


Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Nige White <ni...@forward-comp.co.uk>.
Louis.Masters@log-net.com wrote:

>
> Nige:
>
> I can get 8 pages of your PO to render into PDF (around 900 rows I 
> think), but only by increasing my JVM memory to a 400M.  It may be 
> lower, but 400 is all I tested.
>
> My env is as follows:
>
> FOP 0.20.3
> JDK 1.4.1
> Win2K
> Command line:  java -Xmx400M org.apache.fop.apps.Fop -fo nigehelp.fo 
> -pdf nigehelp.pdf


I am using fop-0.91beta, JDK 1.4, WinXP Pro/JDK 1.4, SCO.

Setting the max heap to 400Mb worked! OK, so it was just keeping a whole 
load of data in the heap. I'll remember that. Thanks,

Nige

_____________________________________________________________________
This message has been checked for all known viruses. Virus scanning
powered by Messagelabs http://www.messagelabs.com For more information
e-mail : hostmaster@forward-comp.co.uk


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


Re: java.lang.OutOfMemoryError processing fairly large table to PDF

Posted by Lo...@log-net.com.
Nige:

I can get 8 pages of your PO to render into PDF (around 900 rows I think), 
but only by increasing my JVM memory to a 400M.  It may be lower, but 400 
is all I tested.

My env is as follows:

FOP 0.20.3
JDK 1.4.1
Win2K
Command line:  java -Xmx400M org.apache.fop.apps.Fop -fo nigehelp.fo -pdf 
nigehelp.pdf

I can send you the PDF if you want?

-Lou

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content, 
the information contained herein is privileged and confidential 
information/work product. The communication is intended for the use of the 
individual or entity named above.  If the reader of this transmission is 
not the intended recipient, you are  hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please 
notify the sender immediately by telephone (732-758-6800) or by electronic 
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper 
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Nige White <ni...@forward-comp.co.uk> wrote on 02/07/2006 07:54:23 AM:

> I have a FOP document which is being generated by an XML transformation 
> from CSV.
> 
> I have a SAX parser which reads CSV, and fires events to make it look 
> like an XML document. This is processed into FO XML by an XSL 
> transformation.
> 
> Now the particular data I have is test data, and is quite large with a 
> lot of columns (They're user selected, so I selected all available just 
> to squeeze out this kind of problem!). This means that the table is very 

> wide.
> 
> In order to fit it into A4, the XSL transformation does a bit of testing 

> on the width, first setting orientation to landscape, and then if it 
> still doesn't fit, it scales down the font it uses (It's coded to use 
> Arial) from 10 points to whatever's necessary. This case is unrealistic 
> because there are so many columns, it has to go down to a font size of 
> 2.48 points, *but it should still create the PDF* - you'd just have to 
> scale it up in Acrobat to read it!!!!
> 
> The problem is, that FOP is blowing up with an "Out of memory" 
exception.
> 
> I'm not asking it to process *that much* data. It should really be able 
> to process a table with 37 columns and 386 rows (including the header)!
> 
> Here is the FO with all the table rows except the header, and first line 

> of data removed. If you process that into PDF, it works OK.
> 
> The real data basically just goes on in the same vein the way data tends 

> to, so to test it, just copy the table data row, and paste it in 385 
> times. Why does it blow up, I'm not doing anything wrong am I? Not 
> creating forward references like "Page n of n"?
> 
> HEEEEEELLLPPP!
> 
> Thanks,
> 
> Nige
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>  <fo:layout-master-set>
>    <fo:simple-page-master master-name="repeating" margin-top="1cm" 
> margin-bottom="1cm" margin-left="1cm" margin-right="1cm" 
> page-width="29.7cm" page-height="21cm">
>      <fo:region-body margin-bottom="0.75cm" margin-top="1.25cm" 
> margin-left="0cm"/>
>      <fo:region-before extent="1.25cm"/>
>      <fo:region-after extent="0.75cm"/>
>    </fo:simple-page-master>
>    <fo:page-sequence-master master-name="repeating_pm">
>      <fo:repeatable-page-master-reference maximum-repeats="no-limit" 
> master-reference="repeating"/>
>      <fo:single-page-master-reference master-reference="repeating"/>
>    </fo:page-sequence-master>
>  </fo:layout-master-set>
>  <fo:page-sequence initial-page-number="1" 
master-reference="repeating_pm">
>    <fo:static-content flow-name="xsl-region-before">
>      <fo:block space-after="1mm" font-weight="bold" 
> text-decoration="underline" font-size="15pt" 
> text-align="center">Purchase Order Report</fo:block>
>      <fo:block space-after="5mm" font-weight="normal" font-size="10pt" 
> text-align="center">Generated by ForwardOffice on 07-Feb-2006</fo:block>
>    </fo:static-content>
>    <fo:static-content flow-name="xsl-region-after">
>      <fo:block line-height="14pt" font-family="sans-serif" 
> font-size="10pt" space-before="2.5mm" text-align="center">Page
>        <fo:page-number/>
>      </fo:block>
>    </fo:static-content>
>    <fo:flow flow-name="xsl-region-body">
>      <fo:block font-size="2.48pt">
>        <fo:table border-collapse="collapse" table-layout="fixed" 
> width="775.69pt">
>          <fo:table-column column-width="24.87pt"/>
>          <fo:table-column column-width="13.43pt"/>
>          <fo:table-column column-width="17.91pt"/>
>          <fo:table-column column-width="12.93pt"/>
>          <fo:table-column column-width="18.40pt"/>
>          <fo:table-column column-width="49.75pt"/>
>          <fo:table-column column-width="11.44pt"/>
>          <fo:table-column column-width="17.16pt"/>
>          <fo:table-column column-width="17.16pt"/>
>          <fo:table-column column-width="20.89pt"/>
>          <fo:table-column column-width="13.93pt"/>
>          <fo:table-column column-width="19.90pt"/>
>          <fo:table-column column-width="18.40pt"/>
>          <fo:table-column column-width="07.96pt"/>
>          <fo:table-column column-width="16.17pt"/>
>          <fo:table-column column-width="8.45pt"/>
>          <fo:table-column column-width="26.86pt"/>
>          <fo:table-column column-width="41.29pt"/>
>          <fo:table-column column-width="21.89pt"/>
>          <fo:table-column column-width="22.63pt"/>
>          <fo:table-column column-width="18.40pt"/>
>          <fo:table-column column-width="30.59pt"/>
>          <fo:table-column column-width="34.82pt"/>
>          <fo:table-column column-width="37.56pt"/>
>          <fo:table-column column-width="34.58pt"/>
>          <fo:table-column column-width="24.13pt"/>
>          <fo:table-column column-width="17.66pt"/>
>          <fo:table-column column-width="22.88pt"/>
>          <fo:table-column column-width="18.40pt"/>
>          <fo:table-column column-width="11.19pt"/>
>          <fo:table-column column-width="9.70pt"/>
>          <fo:table-column column-width="20.89pt"/>
>          <fo:table-column column-width="20.89pt"/>
>          <fo:table-column column-width="17.91pt"/>
>          <fo:table-column column-width="17.91pt"/>
>          <fo:table-column column-width="17.66pt"/>
>          <fo:table-column column-width="18.90pt"/>
>          <fo:table-header background-color="#A3C9F1">
>            <fo:table-row>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Order 
> Number</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Delivery</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Issue 
> Date</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Currency</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Order 
> Value</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Supplier 

> Name</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Country</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Freight 
> Cost</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Other 
> Costs</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Demurrage/Ren</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">GOH 
> Sets</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Carton 
> Type</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Gross 
> Weight</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">POL</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Volume 
> m3</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">POD</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Vessel/Flight</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Carrier 
> Name</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">B/Lading/MAWB</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Consignment Ref</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Entry 
> Number</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Place of 

> Delivery</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Product 
> Code</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Product 
> Short Name</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Class 
> Description</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Colour</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Cost Per 

> Unit</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Commodity Code</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Total 
> Value</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Cartons</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Units</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Range/Look</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Style</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Ex-Factory</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">ETA 
> UK</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" 
> font-weight="bold">Cleared</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="center" font-weight="bold">Proof 
> Delivery</fo:block>
>              </fo:table-cell>
>            </fo:table-row>
>          </fo:table-header>
>          <fo:table-body>
>            <fo:table-row background-color="#E2ECF8">
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" 
margin-left="4pt">1</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" 
margin-left="4pt">2</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-left="4pt">01-Jul-2004</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
margin-right="4pt">0</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
> margin-right="4pt">0.00</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
margin-right="4pt">0</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="right" 
margin-right="4pt">0</fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"/>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"></fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"></fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"></fo:block>
>              </fo:table-cell>
>              <fo:table-cell border="1pt solid lightgrey">
>                <fo:block text-align="left" margin-left="4pt"></fo:block>
>              </fo:table-cell>
>            </fo:table-row>
>          </fo:table-body>
>        </fo:table>
>      </fo:block>
>    </fo:flow>
>  </fo:page-sequence>
> </fo:root>
> 
> 
> _____________________________________________________________________
> This message has been checked for all known viruses. Virus scanning
> powered by Messagelabs http://www.messagelabs.com For more information
> e-mail : hostmaster@forward-comp.co.uk
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>