Project

Profile

Help

Trax OutOfMemoryError

Added by Anonymous about 16 years ago

Legacy ID: #5243010 Legacy Poster: Tomas Jetelina (smrk)

In xslt ant tasks Saxon9 transformations (net.sf.saxon.TransformerFactoryImpl) require much more memory than cmd invoke of net.sf.saxon.Transform. Problem occurs when many files are accessed in one transformation via xsl:documet() and when sending many files to input. Some workaround other than replace ant tasks with direct calls to saxon?


Replies (3)

Please register to reply

RE: Trax OutOfMemoryError - Added by Anonymous about 16 years ago

Legacy ID: #5243060 Legacy Poster: Michael Kay (mhkay)

I suspect the problem is that the Ant task, when transforming many input files using the same stylesheet, reuses the JAXP Transformer object rather than the Templates. With Saxon, it's best to reuse the Transformer if the two transformations access the same source documents, but to create a new Transformer from the Templates object otherwise. But the Ant people, of course, are more familiar with Xalan which may have different optimizations. Unfortunately Saxon's AntTransform task inherits this behaviour so it won't help you. But you could try fixing it yourself at source.

RE: Trax OutOfMemoryError - Added by Anonymous about 16 years ago

Legacy ID: #5243159 Legacy Poster: Tomas Jetelina (smrk)

Thanks for swift response. Xalan has similar problems with caching. I was afraid of your solution :) To get source compiled in debugger with no error requires lot of downloading additional libraries. And with Saxon for Java even .Net stuff :( I will try to modify Ant Trax source (or rewrite xsl to java, cause I already failed with Xalan :).

RE: Trax OutOfMemoryError - Added by Anonymous about 16 years ago

Legacy ID: #5243273 Legacy Poster: Michael Kay (mhkay)

Saxon's AntTransform class is a single-class product, you don't need to build the whole of Saxon. In fact, I've done the source code changes but haven't yet tested them - if you raise an entry in the "support requests" tracker then I'll attach the untested source in my response.

    (1-3/3)

    Please register to reply