简体   繁体   中英

How to avoid truncated stack traces with Java Flight Recorder

I am using Oracle Java Flight Recorder to collect stack trace samples of a Java application. Theses stack traces allows me to eventually produce a CPU Flamegraph .

My issue is that stack traces deeper than 64 frames are truncated by Java Flight Recorder. It's very easy to observe in the Flamegraph and using a debugger I can observe that no FLRStackTrace has more than 64 FLRFrame s and that almost all stack traces with 64 frames have their TruncationState set to TRUNCATED .

Does anyone know if this 64 frames limit can be increased ? Flamegraphs are useless if the stack traces are incomplete.

Yep! But not if you're running on JRockit. If running on HotSpot, simply use the flag -XX:FlightRecorderOptions=stackdepth=<n> , where n, as you have discovered, defaults to 64.

More info here: http://hirt.se/blog/?p=364

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM