Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ANT to run multiple XSpec tests from same target runs out of memory #63

Open
GoogleCodeExporter opened this issue Jun 8, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

If you run an ANT script which has a target that invokes multiple XSpec tests, 
the system can rapidly run out of memory. 

This appears to be an underly bug in the ANT xslt task used by XSpec. This 
seems to hold on to memory at least until the entire target has completed. 
Therefore if you are running many tests from one target memory can quickly 
become exhausted.

A basic workaround would be to define an alternative to the "xslt" ANT task by 
adding to the XSpec "build.xml" a new macrodef such as:

<macrodef name="AlternateXslt">
    <attribute name="in"/>
    <attribute name="out"/>
    <attribute name="style"/>
    <attribute name="classpath"/>
    <sequential>
      <java classpath="@{classpath}" classname="net.sf.saxon.Transform" fork="true">
        <arg value="-s:@{in}"/>
        <arg value="-xsl:@{style}"/>
        <arg value="-o:@{out}"/>
      </java>
    </sequential>
  </macrodef>


Then replace the occurrences of the <xslt> task with <AlternativeXslt> e.g.

 <AlternateXslt in="${xspec.xml}" 
             out="${xspec.xsl}"
             style="${xspec.project.dir}/src/compiler/generate-xspec-tests.xsl"
             classpath="${saxon.jar}"/>

and 

 <AlternateXslt in="${xspec.result.xml}" 
             out="${xspec.result.html}"
             style="${xspec.project.dir}/src/reporter/format-xspec-report.xsl"
             classpath="${saxon.jar}"/>


This solution relies on saxon being available as the XSLT processor.

Original issue reported on code.google.com by [email protected] on 7 Oct 2013 at 3:50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant