I have a long-running web application that performs a lot of XSLT transformations over time. It doesn't have a large load, that is not too many concurrent transformations going on at any given time, but over time we are consistently getting OutOfMemoryErrors after it runs for several days.
We're using Xalan 2.7.0 in a 1.5 JDK on Linux. I started analyzing a heap dump created after the last memory error, and by far the most memory consumed (over 1.5gb) seems to all be related to Xalan/Xerces, mostly coming from arrays of integers referenced by instances of org.apache.xml.utils.SuballocatedIntVector (568228 instances in this heap dump, referring to 669173 int[] instances). We only use JAXP APIs for transforming documents and never interact with Xalan or Xerces directly in our code. Most of the transformations are done from Templates instances, but we do have cases of using the JAXP XPath API or one-off Transformer instances. I found in the heap dump there were a few instances of the DTMManagerDefault class, and some of them had m_dtms arrays of a very large size (for example 13568 in one case). Looking at the JavaDocs for that field, it mentions " Growth is uncommon..." for this array. I was wondering if these DTM instances are not getting released somehow? -- m@