java 飞行记录器如何转储异常,FlightRecordingDumpOnUnhandledException

java flight recorder how to dump on exception, FlightRecordingDumpOnUnhandledException

java版本1.7.0_79 Java(TM) SE 运行环境(build 1.7.0_79-b15) Java HotSpot(TM) 64 位服务器 VM(内部版本 24.79-b02,混合模式)

我使用的参数

-XX:+UnlockCommercialFeatures 
-XX:+FlightRecorder  
-XX:+FlightRecordingDumpOnUnhandledException -XX:StartFlightRecording=duration=6m,filename=member.jfr"
-XX:FlightRecorderOptions=loglevel=debug,delay=2m,maxsize=2g"

错误

Unrecognized VM option 'FlightRecordingDumpOnUnhandledException'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

正确的使用选项是什么?在异常时转储记录

-XX:+FlightRecordingDumpOnUnhandledException 仅适用于 JRockit。 Hotspot (JDK7/8)

不存在类似选项

Use the template manager that is available in Mission Control.

Go to Windows -> Template Manager and import the template and check Heap Statistics and Allocation Profiling, export it. Done!

(我从 similar question 复制粘贴了这段文字,@Kire 也写了它)

基本上,您只需在设置中添加exception-level=all即可。我不知道为什么 Oracle 没有此参数的文档。