开发者

Recurring Exception without a stack trace - how to reset? [duplicate]

This question already has answers here: NullPointerException in Java with no StackTrace (11 answers) Closed 8 years ago.

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" th开发者_如何转开发is 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"...

Thanks!


Try running with the following JVM property:

-XX:-OmitStackTraceInFastThrow

From the Release Notes:

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜