首页 > 其他 > 详细

jvm不打印异常栈

时间:2016-08-30 19:18:10      阅读:170      评论:0      收藏:0      [点我收藏+]

生产环境抛异常,但却没有将堆栈信息输出到日志,确认打印日志方法正确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不打印异常栈

原文:http://www.cnblogs.com/userrain/p/5822915.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!