I'll try that then, thanks. Do I just create and set up the Configuration, then create my input document using Configuration.buildDocument()?

The main reason I am trying to switch to Saxon is for memory reasons - I'm dealing with large documents and am hitting the limit of what I can do with Xalan. With a 45mb input file it was not able to complete the series of 493 transformations I need (out of memory error after about 8 transformations). If I reduce the input file to about 38mb it completes ok. I wanted to switch to Saxon so the process will work with larger files.

After I switched to Saxon I noticed that doing individual transformations seemed to be running much faster, however I found a big problem - the series of 493 transformations broke after only 4 transformations (again, out of memory).

I cut down the test to a smaller input file (2mb, 10 transformations) and ran it with both Xalan and Saxon. Both completed, and Saxon was faster as you would expect. I'm forcing a garbage collection between each transformation, and I got some debug output from that. What it appears to show is that when using Xalan, the memory use does not go up from transform to transform - the GC clears out everything. But with Saxon the memory is rising by around 5mb each time. If you scale this up to the much larger file, and the 493 transformations, you can see there would be a problem there.

Is there something I can do to stop the memory continually rising?
(I've included the debug output below)

Cheers,
Kevin


Xalan
- Xmx1150 10Forms                        MEMORY FREED OK
(EVFPublicationManager.applyTransform() - after creating input,before transform)
Mb Freed: n/a
Mb Used:  56
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 7
Mb Used:  68
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 26
Mb Used:  52
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 12
Mb Used:  53
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 14
Mb Used:  49
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 11
Mb Used:  50
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 3
Mb Used:  59
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 20
Mb Used:  49
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 10
Mb Used:  50
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 10
Mb Used:  51
(EVFPublicationManager.applyTransform() - after 1 of multipart transform)
Mb Freed: 3
Mb Used:  57



Saxon
- Xmx1150 10Forms                        MEMORY NOT FREED
(EVFPublicationManager.applyTransform() - after creating input,before transform)
Mb Freed: n/a
Mb Used:  55
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 28
Mb Used:  35
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 4
Mb Used:  43
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 2
Mb Used:  48
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 5
Mb Used:  53
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 6
Mb Used:  53
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 3
Mb Used:  59
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 5
Mb Used:  64
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 6
Mb Used:  67
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 7
Mb Used:  73
(EVFPublicationManager.applyTransform()- after one part of multi-transform)
Mb Freed: 3
Mb Used:  78



From: "Michael Kay" <mike@saxonica.com>
To: "'Mailing list for the SAXON XSLT and XQuery processor'" <saxon-help@lists.sourceforge.net>
Date: 04/12/2008 14:17
Subject: Re: [saxon] Passing NodeSet parameter from Java





In principle it should still be possible to use a level 2 DOM if you call Configuration.setDOMLevel(2). However, I don't think this has been tested in the most recent releases, so I can't guarantee it still works.
 
Michael Kay
http://www.saxonica.com/