ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Giffin <>
Subject Increase Java heap within xslt task?
Date Mon, 06 Aug 2012 00:53:52 GMT
How can I increase the memory for the xslt task from within Ant 1.8.4, 
not with an environment variable? I am using Saxon by specifying the 
Saxon jar classpath in this target:

   <target name="commands">
     <xslt in="command-spreadsheet.xml" out="out.xml"
       style="intermed.xsl" force="true">
       <classpath location="${saxon}" />

This transform job crashes with "java.lang.OutOfMemoryError: Java heap 
space" unless I set ANT_OPTS=-Xmx256m. But I don't want to have to 
depend on an env variable. Is there a way to increase JVM heap space 
within the xslt task? I can run this same transform successfully with 
the java task like this, using the maxmemory attribute to increase the 
heap space:

   <target name="old">
     <java jar="${saxon}" fork="true" failonerror="true" maxmemory="256m">
       <!-- Source file -->
       <arg value="-s:command-spreadsheet.xml"/>
       <!-- XSLT stylesheet -->
       <arg value="-xsl:intermed.xsl"/>

There is no maxmemory attribute for the xslt task. I would rather use 
the xslt task if I can.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message