当我使用 Epsilon GC 时,我无法使用 Flight Recorder。

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

When I use Epsilon GC, I cannot use Flight Recorder

问题

我正在运行这条命令

java -cp "D:\Dev\Books Spaces\Java-11-and-12-New-Features-master\Chapter09" -XX:StartFlightRecording,filename=Epsilon.jfr -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC exploring_further/TestFlightRecorder

代码在运行,但是.jfr文件的大小为0字节。

当我移除 -XX:+UseEpsilonGC 并且Java默认使用G1 GC 时,代码可以运行,飞行记录器会将所有数据转储到文件中,我可以读取它。

为什么使用Epsilon时文件为空,我应该如何修复它。

在JDK 14、Windows 10上。

英文:

I'm running this command

java -cp "D:\Dev\Books Spaces\Java-11-and-12-New-Features-master\Chapter09" -XX:StartFlightRecording,filename=Epsilon.jfr -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC exploring_further/TestFlightRecorder

The code runs, however the .jfr file is 0 bytes.

When I remove -XX:+UseEpsilonGC and Java defaults to G1 GC. the code runs and the flight recorder dump all the data to file and I can read it.

Why when I use Epsilon the file is empty and how Can I fix it.

On JDK 14 Windows 10.

答案1

得分: 0

我无法在Oracle JDK 14.02(Windows)上重现。

在录制被转储之前,该文件大小为零,转储发生在JVM(正常情况下)退出时,因此您需要等待该过程。

如果应用因OutOfMemoryError而结束,则无法保证会生成录制;如果发生录制,可能是紧急录制(可能缺少信息),并且以前缀hs_oom_pid创建。

英文:

I could not reproduce on Oracle JDK 14.02 (Windows).

The file has zero size until the recording is dumped, which happens when the JVM exits (normally), so you need to wait for that.

If the application ends because an OutOfMemoryError, a recording can't be guaranteed, and if it happens, it is probably an emergency recording (which may lack information) and it is created with the prefix hs_oom_pid.

答案2

得分: 0

我在代码运行时按下Ctrl+C键进行修复,.jfr文件得以生成,因此我可以读取它。如果我等待OutOfMemoryError出现,文件仍然为0字节。

英文:

I fix it by hitting Ctrl+C while the code was running. the .jfr file gets populated and so I can read it. If I wait for OutOfMemoryError The file still 0 bytes.

huangapple
  • 本文由 发表于 2020年9月8日 05:12:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/63784319.html
匿名

发表评论

匿名网友

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

确定