Toadie schrieb am 03.04.2010 um 11:25:25 (-0700):
> Is there a way to approximate the memory footprint needed by Xalan to
> run an XSL?
> 
> For example, i am seeing that with SAX based transformation
> - using Xalan 2.7.0 and java 1.6_u13 with a bootclasspath option to
> force the JDK to load Xalan 2.7.0
> - an input file of size 180 meg
> - and a simple XSL that does identity transformation (see below)
> 
> The required memory footprint for heapsize is approximately 950Mb. --
> my questions are:
> 
> 1. is there a way to approximate the required memory footprint?

I usually reckon with ten times the input source, but in your example
it's only five times. Depends on input size and number of nodes, I
think. You could do some experiments with various input document sizes
and structures (few large text nodes, or many small nodes) to get a
feeling for how much memory is required.

> 2. with SAX based processing, why does the 180Mb input file require
> such high overhead of heap memory?

SAX here is just the method to build the input tree in memory. (It could
also be built from DOM, which would make sense if you already had a DOM
in your application.)

XSLT allows random access to the input, so if it were not entirely in
memory it would be much slower.

You might happen to have a transformation that could be done using
streaming. The commercial version of the Saxon processor allows you to
do that.

http://www.saxonica.com/documentation/sourcedocs/serial.html

Happy Easter,
-- 
Michael Ludwig

Reply via email to