6

我有一个使用 Java Mission Control 创建的配置文件,该配置文件启用了分配分析。当我从 JMC UI 使用它进行录制时,一切正常,我得到了结果。

但是,在导出设置并尝试在命令行上使用 JFR 进行记录后,即使我获得了其他分析信息,我也没有记录分配。

我使用以下设置运行录制: JAVA_OPTS="$JAVA_OPTS -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,settings='<path_to_settings>/settings.jfc',dumponexit=true,dumponexitpath=<output>" java -jar stuff

在 JMC 中加载录音并检查内存部分时,我看到了 message Event type 'Allocation in new TLAB' is not enabled in this recording

设置文件在这里:https ://gist.github.com/jmiettinen/1976f9bbe156ecb5e232并且它具有相关设置java/object_alloc_in_new_TLABjava/object_alloc_outside_TLAB启用。

我在这里错过了什么吗?我正在运行1.8.0_66,并且希望从应用程序启动到停止进行连续记录。

4

2 回答 2

7

Verified with @jmiettin at Jfokus that these flags do the trick:

These options seem to work for me if you want to have a continuous recording with the special settings and get it to dump the data on exit: -XX:FlightRecorderOptions=dumponexit=true,dumponexitpath=rec.jfr -XX:StartFlightRecording=defaultrecording=true,settings=d:/tmp/wop.jfc

Difference is to put defaultrecording and settings parameters after the -XX:StartFlightRecording flag instead.

于 2016-02-10T08:48:08.703 回答
1

您正在运行哪个版本的 JDK?

有一个错误,在 7u76 和 8u20 中修复,如果 defaultrecording=true,设置参数不被遵守。

于 2016-01-22T06:47:39.103 回答