首页 > 代码库 > jvm不打印异常栈
jvm不打印异常栈
生产环境抛异常,但却没有将堆栈信息输出到日志,确认打印日志方法正确logger.error("somthing error", ex);
JVM启动参数加上-XX:-OmitStackTraceInFastThrow(减号表示关闭,加号则表示启用)
原因参考
http://www.oracle.com/technetwork/java/javase/relnotes-139183.html#vm
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.
添加标签
jvm不打印异常栈
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。