Note that there are some explanatory texts on larger screens.

plurals
  1. POXalan XSLT - Out of Memory Heap Space
    primarykey
    data
    text
    <p>My project has a reporting module that gathers data from the database in the form of XML and runs an XSLT on it to generate the user's desired format of report. Options at this point are HTML and CSV.</p> <p>We use Java and Xalan to do all interaction with the data.</p> <p>The bad part is that one of these reports that the user can request is 143MB (about 430,000 records) for just the XML portion. When this is transformed into HTML, I run out of heap space with a maximum of 4096G reserved for heap. This is unacceptable.</p> <p>It seems that the problem is simply too much data, but I can't help but think there is a better way to deal with this than limiting the customer and not being able to meet functional requirements.</p> <p>I am glad to give more information as needed, but I cannot disclose too much about the project as I'm sure most of you understand. Also, the answer is yes; I need all of the data at the same time: I cannot paginate it.</p> <p>Thanks</p> <p><strong>EDIT</strong></p> <p>All the transformation classes I am using are in the javax.xml.transform package. The implementation looks like this:</p> <pre><code>final Transformer transformer = TransformerFactory.newInstance().newTransformer( new StreamSource(new StringReader(xsl))); final StringWriter outWriter = new StringWriter(); transformer.transform( new StreamSource(new StringReader(xml)), new StreamResult(outWriter)); return outWriter.toString(); </code></pre> <p>If possible, I would like to leave the XSLT the way it is. The <code>StreamSource</code> method of doing things should allow me to GC some of the data as it is processed, but I'm not sure what limitations on XSLT (functions, etc) this might require for it to do proper cleanup. If someone could point me at a resource detailing those limitations, it would be very helpful.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload