[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: main memory consumption using xalan

Subject: Re: main memory consumption using xalan
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 30 Jul 2007 13:33:50 +0100
Re:  main memory consumption using xalan
On 7/30/07, Lensch, Thomas <Lensch@xxxxxxxx> wrote:
> Hi,
>
> we use xalan 2.6 in an Tomcat/web-environment using the JAXP 1.3 API to
> run Xalan-Java. We transform our xml documents to generate XHTML pages.
>
> We have many types of xml data. These all are transformed by
> type-specific xsl using some standardard XSL templates. So we have the
> following (simplified) structure:
>
> Template A.xsl for type A:
>
>         <xsl:include href="includes/base.xsl"/>
>         <xsl:tempalte match="*">
>         .....do something
>
> Template B.xsl for type B:
>
>         <xsl:include href="includes/base.xsl"/>
>         <xsl:tempalte match="*">
>         .....do something
>
> and so on for about 20 types
>
> When transformation for a document of type A is done A.xsl and base.xsl
> are loaded and kept in main memory.
>
> When transformation for a document of type B is done B.xsl and A NEW
> INSTANCE of base.xsl are loaded and kept in main memory.
>
> After all we need 20 times the memory for base.xsl! So, main memory is
> wasted and we have costs to allocate this memory.
>
> Does anybody know how to avoid this behaviour?

I suspect you'll be out of luck - the various stylesheets get built
into a single Transformer so A+Base will be a separate Transformer to
B+Base and not share the parsed base.xsl in any way.

If memory is really critical and your specific stylesheets are simple,
then you can probably replace the import behaviour with a choose/when
in base.xsl, but you'd loose all of the maintainability benefits.


-- 
http://andrewjwelch.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.