Stack Depth in Java Flight Recorder

Isuru Perera
1 min readApr 4, 2018

--

Sometimes, you may see only a part of stack traces.

In JFR, the default stack depth limit for the stack traces is 64. This is a performance optimization in JFR and it will make sure that there will be not much performance overhead if you have a huge stack depth. For example, the stack depth will be very high if you have lots of deep recursive calls.

When there are more frames, the stack traces are truncated to the specified limit and the root frame will be unknown and JFR will not be able to build the call tree. These stack traces are grouped under “~ UNCLASSIFIABLE ~.()” in the Call Tree Tab.

Use stackdepth option in -XX:FlightRecorderOptions flag to change the stack depth.

-XX:FlightRecorderOptions=stackdepth=<stack_depth_limit>

Be careful when changing this option as the overhead can be massive depending on the stack depth and JVM will need to write a large amount of stack trace data.

--

--