title: XSLT processing recursion depth
body: <p>First of let me state that I have no clue of XSLT at all. I was given a task to investigate some JVM dumps of a Java OutOfMemory exception that occurred during XSLT processing.</p>
  
  <p>I have found that the OutOfMemory occurred during recursive XSLT processing (we use XALAN).</p>
  
  <p>What I found shocking was that the recursion was >100 000 calls deep. </p>
  
  <p>What are the circumstances under which can a recursion this deep during XSLT processing be acceptable?</p>
  
  <hr>
  
  <p>Note that the thread stack trace is about 300k lines long and filled with a variation of this until the moment the OutOfMemory occurs:</p>
  
  <p><code>at org/apache/xalan/transformer/TransformerImpl.executeChildTemplates(Bytecode PC:150(Compiled Code))</code>
  <code>at org/apache/xalan/templates/ElemElement.execute(Bytecode PC:352(Compiled Code))</code>
  <code>at org/apache/xalan/transformer/TransformerImpl.executeChildTemplates(Bytecode PC:150(Compiled Code))</code></p>