Hello all. First time poster. I'm being plagued by memory issues with this one 
report that uses FOP to render PDFs. What happens is the user (my boss in 
this case) takes some criteria which generates what we consider an average 
result set. We transofrm the results into XML and I've coded an XSL-FO 
stylesheet to transform the xml to FO. I push the XML and the XML-FO into FOP 
(and I've tried both versions of FOP as well as renderX with the same 
problems) and FOP chugs a boat-load of memory then throws an 
OutOfMemoryException. When I up my heap to 512m running on a powerful P4/HT 
with 1G RAM running Mepis Linux it brings the entire system to it's knees. I 
end up needing to restart my X session (Ctrl+Alt+Backspace for all you 
Linux-heads out there) to get back to an operational mode. Now the crazy 
thing is if I run the same report with a somewhat smaller set of data it runs 
fine. The specifics are:

1.2M XML xforms to 38.8M FO which hangs the system.
800K XML xforms in about a minute without crashing the system.

When I run the transform I generally do it in one stage without materializing 
the FO intermediate form. I only ran it through Xalan to see what was being 
generated and why the lag. Now my buddy on the other side of my cube has a 
similar report that doesn't exhibit this behaviour. The difference is that my 
report is much denser than his. In other words, where my report generates a 
fo:table which wraps about 20-100 columns for each row his generates a 
smaller table with much less data in it. We've tried running his through 
Xalan to and hacking/beefing up the generated FO to about 2.56M to see if it 
would choke the engine. While the memory usage did grow significantly during 
execution it didn't choke the system the way mine did. I'm guessing, though I 
never checked, that the hack must have brought the resulting FO verbage up 
over the 38.8M the hangs my report up. I'm completely lost as to what to fix. 
My report was due months ago and I don't have a clue how to make it run 
without choking everything.

Looking at the generated FO I can see nothing odd about it. It's just a bunch 
of fo:tables each nested one deep in an fo:block. I've removed foward 
references to the end page for the "page x of y" message at the footer but 
that didn't fix it entirely. Here's a clip of the generated FO that crashes 
everything starting from the fo:flow that holds the main body:

      <fo:flow flow-name="body">
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.68in"/>
               <fo:table-column column-width="3.39in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="left"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="left">default 
product</fo:block>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.17in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="left">U</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">197</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">69</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-128</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-65.0</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">50</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">0</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-50</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-100.0</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">32</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">0</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-32</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" 
text-align="right">-100.0</fo:block>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
         <fo:block font-size="10pt" start-indent="0in">
            <fo:table table-layout="fixed" background-color="white">
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.59in"/>
               <fo:table-column column-width="0.51in"/>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                     <fo:table-cell border-width="0pt">
                        <fo:block border-width="0pt" text-align="right"/>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>

-- 
Clifton C. Craig, Software Engineer
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to