Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2012, 04:48 AM
Authorized User
 
Join Date: Apr 2011
Posts: 22
Thanks: 4
Thanked 0 Times in 0 Posts
Default Java and XSLT heap space problem

Hello XSL masters,
I am calling XSL from java (saxon). I am using an input file of size 200 MB. When i run the transformer, I get the exception:
Code:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at com.icl.saxon.tinytree.TinyDocumentImpl.appendChars(TinyDocumentImpl.java:174)
	at com.icl.saxon.tinytree.TinyBuilder.characters(TinyBuilder.java:224)
	at com.icl.saxon.output.ProxyEmitter.characters(ProxyEmitter.java:100)
	at com.icl.saxon.om.Stripper.characters(Stripper.java:201)
	at com.icl.saxon.ContentEmitter.flush(ContentEmitter.java:220)
	at com.icl.saxon.ContentEmitter.endDocument(ContentEmitter.java:75)
	at com.icl.saxon.aelfred.SAXDriver.parse(SAXDriver.java:334)
	at com.icl.saxon.om.Builder.build(Builder.java:265)
	at com.icl.saxon.Controller.transform(Controller.java:977)
	at com.myCompany.transformer.FunctionTransformer.myTransformer(FunctionTransformer.java:95)
I tried increasing the heap memory but of no use. What should I do to avoid this exception?

Last edited by imshriram; January 31st, 2012 at 04:55 AM.. Reason: look and feel
 
Old January 31st, 2012, 05:31 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You are using a very old version of Saxon (the 6.x branch) and the first thing I would do would be to move to an up to date version (the current version is 9.4). This won't necessarily solve the problem on its own, but at least it will make it possible to offer some support.

Recent Saxon releases have the option -tree:tinyc which uses the TinyTree model with extra compression, which may make a difference.

For a 200Mb input document, you should be able to do the transformation if you allocate 1Gb of heap space, or 2Gb to be safe (the expansion factor depends on the nature of the data. You didn't say how much you actually allocated.

If that doesn't work, or if the source document gets any bigger, you could look at some of the facilities offered in Saxon-EE such as streaming and document projection to see if they help.

Note that for Saxon-specific problems, it's best to use the saxon-help list on SourceForge. Asking here, it's hit-or-miss who happens to visit the forum on any given day.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 1st, 2012, 01:02 AM
Authorized User
 
Join Date: Apr 2011
Posts: 22
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Thank you so much Kay.

Increasing the size to 1GB helped.

I will bear in mind to post to saxon forums on questions related to saxon.

My voice to move to saxon EE or atleast saxon 9 is not getting heard. Hence stuck with older versions. I am hoping for the best in the upcoming months.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank Space in XSLT Prabhakar XSLT 3 April 9th, 2012 02:29 PM
How can i trim space using XSLT? Mitali XSLT 5 July 25th, 2008 03:15 PM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
Could not reserve enough space for object Heap overcit Apache Tomcat 0 February 23rd, 2006 12:11 PM
Problem calling static Java functions from XSLT FraserS XSLT 6 October 10th, 2005 07:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.