xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karthik <karthik...@yahoo.com>
Subject Re: Possible memory leak
Date Wed, 05 Jul 2006 14:21:42 GMT
Andreas,

Thanks for your comments. Looks like for sure there are FOP references hanging
around that GC could not clear up, which eventually kills the process. Below is
a higher-level layout of the xsl. Let me know if you see anything to improve.

The below xsl is applied to XML's having 500 documents(<DOCUMENT></DOCUMENT>
each in a loop(below is the XML layout). 1 XML of 500 documents produces 1 PDF. 

<DATA>
<DOCUMENT>....</DOCUMENT>
<DOCUMENT>....</DOCUMENT>
<DOCUMENT>....</DOCUMENT>
<DOCUMENT>....</DOCUMENT>
<DOCUMENT>....</DOCUMENT>
<DOCUMENT>....</DOCUMENT>
.
.
.
<DOCUMENT>....</DOCUMENT>
</DATA>

I create a page-sequence for each <DOCUMENT> and page-citation is contained
within each of these page-sequence.

My expectation was that the FOP references would clear out after each PDF is
created(which isn't happening).
 
<xsl:template match="/">
	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
		<fo:layout-master-set>
			<!-- first page -->
       		<fo:simple-page-master master-name="firstPage" 
page-height="11in" page-width="8.5in" margin-left="0.75in" margin-right="0.5in" 
margin-top="0.6in" margin-bottom="0.3in">
<fo:region-body margin-top="1in" margin-bottom="1in">
</fo:region-body>
		<fo:region-before extent="0.6in" precedence="true">
		</fo:region-before>
		<fo:region-after extent="1in" region-name="show-footer" 
precedence="true">
		</fo:region-after>
		<fo:region-end region-name="omr-content-first-page" extent="1in" 
precedence="true">
		</fo:region-end>
</fo:simple-page-master>
<!-- rest pages -->
<fo:simple-page-master master-name="restPage" page-height="11in" 
page-width="8.5in" margin-left="0.75in" margin-right="0.5in" 
margin-top="0.6in" margin-bottom="0.3in">
	<fo:region-body margin-top="1in" margin-bottom="1in">
	</fo:region-body>
	<fo:region-before extent="0.6in" precedence="true">
	</fo:region-before>
	<fo:region-after extent="1in" region-name="show-footer" 
precedence="true">
	</fo:region-after>
	<fo:region-end region-name="omr-content-rest-page" extent="0.0in" 
precedence="true">
	</fo:region-end>
</fo:simple-page-master>
<!-- last Page -->
<fo:simple-page-master master-name="lastPage" page-height="11in" 
page-width="8.5in" margin-left="0.75in" margin-right="0.5in" 
margin-top="0.6in" margin-bottom="0.3in">
<fo:region-body margin-top="1in" margin-bottom="1in">
      </fo:region-body>
	<fo:region-before extent="0.6in" precedence="true">
	</fo:region-before>
	<fo:region-after extent="1in" region-name="show-footer" 
precedence="true">
	</fo:region-after>
	<fo:region-end region-name="omr-content-last-page" extent="1in" 
precedence="true"/>
</fo:simple-page-master>
	 		
   <fo:simple-page-master master-name="pageWithoutFooter" 
page-height="11in" page-width="8.5in" margin-left="0.75in" margin-right="1in" 
margin-top="1.0in" margin-bottom="1.0in">
   	<fo:region-body margin-top="1.6in" margin-bottom="0pt"/>
	<fo:region-before extent="1in"/>
	<fo:region-after extent="0pt" region-name="no-footer"/>
</fo:simple-page-master>
		
	<fo:page-sequence-master master-name="simpleDoc">
   	<fo:repeatable-page-master-alternatives>
   	<fo:conditional-page-master-reference master-reference="firstPage"
page-position="first"/>
   	<fo:conditional-page-master-reference master-reference="lastPage"
page-position="last"/>
   	<fo:conditional-page-master-reference master-reference="restPage"
page-position="rest"/>
   	</fo:repeatable-page-master-alternatives>
   	</fo:page-sequence-master>

  </fo:layout-master-set>


<!-- For each DOCUMENT, call template -->
   		<xsl:for-each select="DOCUMENT">
			<xsl:call-template name="DOCUMENT">
			</xsl:call-template>
		</xsl:for-each>
	</fo:root>
</xsl:template> 

<!-- DOCUMENT template-->
  	 <xsl:template name="DOCUMENT">
  		<fo:page-sequence master-reference="simpleDoc" 
initial-page-number="1">
  		<!--header-->
     		<fo:static-content flow-name="xsl-region-before">
			<fo:block>
          		<fo:external-graphic src="file:C:\img.jpg" 
content-height="55px" content-width="240px"/>
			</fo:block>
     		</fo:static-content>
<!--footer-->
     		<fo:static-content flow-name="show-footer">
				<fo:block>
					<fo:leader leader-length="100%" leader-pattern="rule" 
rule-thickness=".5pt" />
				</fo:block>
</fo:static-content>

			<fo:static-content flow-name="no-footer">
				<fo:block/>
			</fo:static-content>

<fo:flow flow-name="xsl-region-body">
     			<xsl:apply-templates/>
				<!--last page reference -->
				<fo:block id="{generate-id(.)}"/>
</fo:flow>
  		</fo:page-sequence>
  		
    </xsl:template> 

......

Let me know if you see some red flags.....

Thank youvery much!
-Karthik




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


Mime
View raw message