[ https://issues.apache.org/jira/browse/XALANJ-2608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17066378#comment-17066378 ]
Mukul Gandhi commented on XALANJ-2608: -------------------------------------- I'd prima facie assume that, you're facing this issue due to large size of your XML input document. An XML input document size of the order 435 MB would be considered very large for an XSLT 1.0 transform, on a typical developer system configuration. I'd suggest following course of actions in order, to try solving this issue, 1) Try having a smaller sized XML input document (for e.g, 1-2 MB), that obeys the schema of your original bigger XML input document. Test the XSLT transform on that. If that works, then you could be sure that, the large size of XML input document is the likely cause of the issues you're facing. If this is the issue, then I'd suggest following measures for solution, * Raise the JVM maximum heap size with option -Xmx. It may also be required, to custom set the JVM initial heap size with option -Xms. * Try using the 64 bit JVM (which most of the people use these days), with which JVM maximum heap size can be specified much larger than 32 bit JVM. 2) Try having an XSD schema of your XML input document, and also for the XML output document. It's good to have these artifacts, for an XSLT use case, these days. These artifacts are also useful, to share with people whose help is saught, so that they (and you of course) can quickly understand the schema of XML documents within an XSLT transform. Having XSD schemas, within an XSLT use case, also allows you to process your XML documents with schemas prior and after the XSLT transform, which shall avoid lots of logic (particularly error handling) within the XSLT stylesheet. Please try doing above steps (at least the 1st one), and let us know how that goes. > Java Heap Space Error from DTMDefaultBase > ----------------------------------------- > > Key: XALANJ-2608 > URL: https://issues.apache.org/jira/browse/XALANJ-2608 > Project: XalanJ2 > Issue Type: Bug > Security Level: No security risk; visible to anyone(Ordinary problems in > Xalan projects. Anybody can view the issue.) > Components: DTM > Affects Versions: 2.7.1, 2.7.2 > Environment: Windows 7 Entreprise Service Pack 1 > Java 8 update 122 - MaxHeapSize = 4GB > Reporter: khaled khalifa > Assignee: Steven J. Hathaway > Priority: Major > Attachments: IBXsltUtils.java, PIM_export.xslt, XSLTSample.java, > java_leak_problem.PNG > > > When trying to gnerate a large xml file (1.5 GB) via un batch (spring-batch) > we get a *java.lang.OutOfMemoryError: Java heap space* > {code} > java.lang.OutOfMemoryError: Java heap space > at > org.apache.xml.dtm.ref.DTMDefaultBase.ensureSizeOfIndex(DTMDefaultBase.java:302) > at > org.apache.xml.dtm.ref.DTMDefaultBase.indexNode(DTMDefaultBase.java:328) > at > org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.startElement(SAX2DTM.java:1887) > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown > Source) > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown > Source) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown > Source) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown > Source) > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown > Source) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > Source) > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown > Source) > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown > Source) > at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown > Source) > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown > Source) > at > org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:439) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:701) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) > {code} > In the attachment you may find a screenshot of the java analyser for the leak -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org