Java heap space error is throwing " while transforming 550 mb document" eventhough heap space is higher than document size

StackOverflow https://stackoverflow.com/questions/22089213

문제

A Java heap space error is thrown " while transforming 550 MB document" even though heap space is higher than a document size.

My code uses

1.xsl:stylesheet of xslt transformation
2.net.sf.saxon.TransformerFactoryImpl
3.trans.transform(new StreamSource(file), result);

Thanks, Mani

올바른 솔루션이 없습니다

다른 팁

Typically with Saxon the space occupied by the source document as a tree is around 5 times the size of the lexical XML. The ratio can vary, of course, depending on the complexity of the document. So for 550Mb, allocating 3Gb should be enough. Use the -Xmx option when starting up Java to allocate enough heap space.

You're close to the limits of what can be done using a conventional in-memory transformation, so you might like to look at the options for doing a streamed transformation. For information on this, see http://saxonica.com/documentation/#!sourcedocs/streaming

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top