简体   繁体   English

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

[英]When I use Epsilon GC, I cannot use Flight Recorder

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.代码运行,但是 .jfr 文件是 0 字节。

When I remove -XX:+UseEpsilonGC and Java defaults to G1 GC.当我删除-XX:+UseEpsilonGC ,Java 默认为 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.为什么当我使用 Epsilon 时文件是空的,我该如何修复它。

On JDK 14 Windows 10.在 JDK 14 Windows 10 上。

I could not reproduce on Oracle JDK 14.02 (Windows).我无法在 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.在转储记录之前,该文件的大小为零,这发生在 JVM 退出(通常)时,因此您需要等待。

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.如果应用程序因为 OutOfMemoryError 而结束,则无法保证录制,如果发生,则可能是紧急录制(可能缺少信息)并使用前缀 hs_oom_pid 创建。

I fix it by hitting Ctrl+C while the code was running.我通过在代码运行时Ctrl+C修复它。 the .jfr file gets populated and so I can read it. .jfr 文件被填充,所以我可以阅读它。 If I wait for OutOfMemoryError The file still 0 bytes.如果我等待 OutOfMemoryError 文件仍然是 0 字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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