避免Java异常栈被吞掉

The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow.

-XX:-OmitStackTraceInFastThrow

https://stackoverflow.com/questions/4659151/recurring-exception-without-a-stack-trace-how-to-reset
https://yoshihisaonoue.wordpress.com/2021/02/07/jvm-option-xx-omitstacktraceinfastthrow/

posted @ 2022-09-20 13:14  血染河山  阅读(125)  评论(0编辑  收藏  举报