XSLT step leaks memory when a SaxonApiException is thrown on a stylesheet compile
We are currently reusing the XPipeline instance for multiple executions with calls originating from a single JVM, however under certain error conditions we have experienced memory leaks. We have investigated further and found the culprit was in XLST.java
However if an exception occurs during the stylesheet compile this step above is not performed leaving a new CollectionResolver in memory referencing the previous instance, this repeats for each subsequent execution leading to a large memory leak. Further analysis has shown another instance of this bug to be present is XQuery.java.
A quick workaround would be to move the statement config.setCollectionURIResolver(collectionResolver); into a finally block after the stylesheet compilation.
The text was updated successfully, but these errors were encountered: