title: how to expand size of Java stack trace to see bottom of stack? (triggering a stack overflow)
body: <p>In Java, is there any way to view the complete, untruncated stack trace (e.g. by increasing the number of frames recorded), or otherwise get at the <em>bottom</em> of a stack trace?  Normally the stack trace is truncated from the top at 1024 frames worth, but for a stack overflow problem this is fairly worthless as you really need to see who made the call that triggered the recursion, down near the bottom.  Much better would truncation in the <em>middle</em> of the stack, but evidently Sun's JVM isn't smart enough to do this.</p>
  
  <p>Perhaps even some special Sun-specific flags?  I tried reducing the stack size to the minimum allowable (-Xss1000) but that's still more than 1024 frames worth.</p>
  
  <p>In my case, I'm trying to debug a stack overflow that occurs in a Hadoop mapper, but only when running on really large input.  I assume the problem comes because a recursive operation (Scala's <code>foldRight</code>) is being done on a really, really large linked list, and I need to rewrite it non-recursively ...  but I need to know who made the call to <code>foldRight</code>.  This is a basic routine called directly and indirectly in a lot of places and there's lots and lots of code out there that I'm working with, so this is highly non-obvious.</p>