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

Re: "Heap" of trouble handling input file of 500 MByte

Subject: Re: "Heap" of trouble handling input file of 500 MByte
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 21 Feb 2011 23:20:49 +0000
Re:  "Heap" of trouble handling input file of 500 MByte
On 21/02/2011 21:24, thehulk@xxxxxxxxxxx wrote:
Thanks for all these suggestions. I tried to use Saxon but ran into typical problems. I have not found an endorsed dir anywhere, and after looking at about a dozen webpages, I am ready to give up and ask: how to put it into the endorsed dir? Also very usable: how to make this one program use the Saxon classes?
I did download files saxon8.jar and saxon9he.jar .

If your application is using the JAXP interfaces, and if you have access to the source code, then by far the simplest way to switch it to using Saxon is to change the line

TransformerFactory f = TransformerFactory.newInstance();

to say instead

TransformerFactory f = new net.sf.saxon.TransformerFactoryImpl();

If you don't have access to the source code, then the simplest is to set the Java system property javax.xml.transform.TransformerFactory to the value "net.sf.saxon.TransformerFactoryImpl".

However, if you are processing 500Mb input documents you are still going to need rather more than the 1Gb of heap space that you seem able to allocate: I would recommend a minimum of 4x input document size, and it can be more than that depending on the nature of the XML source.

A surprisingly simple measure that is often overlooked is to set <xsl:strip-space elements="*"/> - however, it doesn't make much difference on recent versions of Saxon because Saxon will compress the whitespace anyway.

Michael Kay

Current Thread


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

Buy Stylus Studio Now

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.
First Name
Last Name
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-2013 All Rights Reserved.