Project

Profile

Help

saxon 9sa gives outofmemory error

Added by Anonymous about 15 years ago

Legacy ID: #6203186 Legacy Poster: Revathy Samy (revathyo)

I tried to transform xml of size 20 mb with xsl using saxon 9sa evaluation version. I am getting outofmemory error. I used to test using command line. Following is the command i tried java -cp C:\saxona\licence;saxon9sa.jar com.saxonica.Transform -s:tran _1_7_20090115143454.xml -xsl:transactions_en.xsl -o:C:\saxona\out.html Saxon-SA evaluation license expires in 29 days Warning: at xsl:stylesheet on line 2 column 80 of transactions_en.xsl: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(Unknow n Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.refres h(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.invokeListen ers(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanContent( Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp l$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U nknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next (Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp l.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U nknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U nknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So urce) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un known Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p arse(Unknown Source) at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:404) at net.sf.saxon.event.Sender.send(Sender.java:214) at net.sf.saxon.event.Sender.send(Sender.java:50) at net.sf.saxon.Controller.transform(Controller.java:1611) at net.sf.saxon.Transform.processFile(Transform.java:1112) at net.sf.saxon.Transform.doTransform(Transform.java:719) at com.saxonica.Transform.main(Transform.java:40) Anyone please reply to this problem.


Replies (3)

Please register to reply

RE: saxon 9sa gives outofmemory error - Added by Anonymous about 15 years ago

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

Try allocating more memory, e.g. using java -Xmx1024m

RE: saxon 9sa gives outofmemory error - Added by Anonymous about 15 years ago

Legacy ID: #6211318 Legacy Poster: Revathy Samy (revathyo)

Increasing heap size would affect other processes performance. Is there any other solution like passing the xml in streams to handle this problem? I thought that saxon is stream based which handles this situation instead of loading the whole document in memory.

RE: saxon 9sa gives outofmemory error - Added by Anonymous about 15 years ago

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

Saxon-SA does have facilities for streaming of large documents: see http://www.saxonica.com/documentation/sourcedocs/serial.html But you have to write your code in the right way. XPath allows free navigation within a document (for example count(//x)=count(//y)) and general XPath constructs can only be evaluated by building the full tree in memory.

    (1-3/3)

    Please register to reply