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

后端 未结 4 1795
傲寒
傲寒 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 23:05

    You can iterate over the stack trace yourself

    Throwable t =
    
    for(StackTraceElement ste: t.getStackTrace()) {
        // is it a repeat??
    
    }
    

    The default printStackTrace will print every level which has been recorded. Your problem is that the stack is too deep for what it put in the stack trace.

    Can you try reducing your stack size?

提交回复
热议问题