how to expand size of Java stack trace to see bottom of stack? (triggering a stack overflow)

后端 未结 4 1807
傲寒
傲寒 2020-12-18 22:25

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 bottom of a stac

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 22:59

    Try the -XX:MaxJavaStackTraceDepth JVM option.

    Here is a description from Stas's Blog

    Max. no. of lines in the stack trace for Java exceptions (0 means all). With Java > 1.6, value 0 really means 0. value -1 or any negative number must be specified to print all the stack (tested with 1.6.0_22, 1.7.0 on Windows). With Java <= 1.5, value 0 means everything, JVM chokes on negative number (tested with 1.5.0_22 on Windows).

提交回复
热议问题