循环异常没有堆栈跟踪 - 如何重置? [英] Recurring Exception without a stack trace - how to reset?

查看:148
本文介绍了循环异常没有堆栈跟踪 - 如何重置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序日志(使用log4j)中,我看到一个NullPointerException,但没有堆栈跟踪。我知道,作为优化,当异常发生多次时,jvm将停止生成堆栈跟踪。问题是在一段时间之前发生的异常,并且我的所有日​​志都填满了没有堆栈跟踪的异常。有没有办法重置这个机制,所以下一个抛出的异常将打印完整的堆栈跟踪?我不想重新启动应用程序,因为很难重现此错误,重新启动可能会导致离开...

In my application log (using log4j), I see a NullPointerException, but without the stack trace. I know that as an optimization, when an exception occurs many times - the jvm stops producing the stack trace. The problem is the exception occurred some time ago, and all my logs are filled with the exception without the stack trace. Is there a way to "reset" this mechanism, so the next thrown exception will be printed with the full stack trace? I don't want to restart the application, as it is hard to reproduce this bug, and restarting may cause to "go away"...

谢谢! p>

Thanks!

推荐答案

尝试运行以下JVM属性:

Try running with the following JVM property:

-XX:-OmitStackTraceInFastThrow

发行说明


服务器VM中的编译器现在

提供了正确的堆栈回溯所有冷内置异常。对于
的性能目的,当这种
异常被抛出几次时,
方法可能会被重新编译。在
重新编译之后,编译器可以选择
更快的策略,使用未提供堆栈
跟踪的预分配的
异常。要完全禁用
的预分配异常,请使用此
新标志:
-XX:-OmitStackTraceInFastThrow

这篇关于循环异常没有堆栈跟踪 - 如何重置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆