-XX:-StackTraceInThrowable
This option removes stack traces from exceptions.
Syntax
-XX:-StackTraceInThrowable
Setting | Effect | Default |
---|---|---|
-XX:-StackTraceInThrowable |
Disable | No |
-
While stack traces are included in exceptions by default, recording them can have a negative impact on performance. Use this option if you want to remove stack traces, although this might cause difficulties with problem determination.
When this option is enabled,
Throwable.getStackTrace()
returns an empty array and the stack trace is displayed when an uncaught exception occurs.Thread.getStackTrace()
andThread.getAllStackTraces()
are not affected by this option.