While running pipelines using validate-with-xml-schema, we have found that exceptions thrown when the XML document fails to meet the schema cause a memory leak. In fact it would seem that in general if any processor throws an exception within a pipeline that a memory leak can result.
We have investigated the cause of this and it appears the leaks are being caused by a failure to clean up the data associated with the XProcData object. For example we have found several occurrences of the following sort of code:
XProcData data = runtime.getXProcData();
data.openFrame(this);
...calls a method that throws an exception e.g. xstep.run()
data.closeFrame(); // Does not get called after exception thrown, leading to a memory leak
It seems this pattern is repeated in several of the classes, including:
While running pipelines using validate-with-xml-schema, we have found that exceptions thrown when the XML document fails to meet the schema cause a memory leak. In fact it would seem that in general if any processor throws an exception within a pipeline that a memory leak can result.
We have investigated the cause of this and it appears the leaks are being caused by a failure to clean up the data associated with the XProcData object. For example we have found several occurrences of the following sort of code:
It seems this pattern is repeated in several of the classes, including:
XAtomicStep.java XChoose.java XCompoundStep.java XPipeline.java
A workaround to this would be to move the closeFrame() call into a finally block.
Please let me know if any more information would be helpful.