Java Flight Recorder – 在JDK17上记录参数

huangapple go评论69阅读模式
英文:

Java Flight Recorder - Logging parameters on JDK17

问题

我的 jfr 日志中没有关于内存/TLAB分配部分的任何信息,如果使用 MissionControl 进行分析。

JVM 参数(JDK17):

-XX:+UnlockDiagnosticVMOptions -X::+DebugNonSafepoints -XX:UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay....filename=... loglevel=info

附注:FlightRecorderOptions 已解除并且不可在 LTS JDK17 中使用

JVM 参数(JDK8):

-XX:+UnlockDiagnosticVMOptions -X::+DebugNonSafepoints -XX:UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay....filename=... -XX:FlightRecorderOptions=loglevel=info

在 JDK8 中,我拥有所有的数据,我有点困惑,如果我缺少 'Memory/TLAB Allocation' 的问题是由于 JFR 的 JVM 参数不正确引起的?

--更新--

https://bugs.openjdk.org/browse/JDK-8225312 废弃 -XX:FlightRecorder

英文:

My jfr log does not contain any information about Memory / TLAB Allocation section , if analyze it by MissionControl

JVM parameters (JDK17):

-XX:+UnlockDiagnosticVMOptions -X::+DebugNonSafepoints -XX:UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay....filename=... loglevel=info

P.S. FlightRecorderOptions decom'ed and not available in LTS JDK17

JVM parameters (JDK8):

-XX:+UnlockDiagnosticVMOptions -X::+DebugNonSafepoints -XX:UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay....filename=... -XX:FlightRecorderOptions=loglevel=info

On JDK8 I have all data in place, I'm a bit puzzled what if my issue about missing 'Memory/TLAB Allocation' is caused by incorrect JVM parameters for JFR ?

--Update--

https://bugs.openjdk.org/browse/JDK-8225312 Deprecate -XX:FlightRecorder

答案1

得分: 1

The TLAB events were disabled in settings=profile when the Object Allocation Sample event was introduced in JDK 16 (as it has less overhead and is enabled by default)

You can enable TLAB events manually:

java -XX:StartFlightRecording:
jdk.ObjectAllocationInNewTLAB#enabled=true,
jdk.ObjectAllocationOutsideTLAB#enabled=true,filename=...

英文:

The TLAB events were disabled in settings=profile when the Object Allocation Sample event was introduced in JDK 16 (as it has less overhead and is enabled by default)

You can enable TLAB events manually:

java -XX:StartFlightRecording:
         jdk.ObjectAllocationInNewTLAB#enabled=true,
         jdk.ObjectAllocationOutsideTLAB#enabled=true,filename=...

答案2

得分: 0

"-XX:+UseTLAB"作为参数添加应该可以解决问题。

希望这有所帮助。

祝好。

英文:

Adding -XX:+UseTLAB as a parameter should do the trick.

Hope that works/helps.

Cheers

huangapple
  • 本文由 发表于 2023年6月13日 17:00:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463274.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定