0

guys. In my case, I guess gc log rotating cause a long pause safepoint almost 10s.And I find we can print gc log rotating cost in JDK8u242+ with UseGCLogFileRotation Flags:https://bugs.openjdk.org/browse/JDK-8231398?jql=text%20~%20%22GC%20log%20rotation%22%20ORDER%20BY%20created%20DESC%2C%20affectedVersion%20DESC

But in openJDK11, the UseGCLogFileRotation flag had been removed, and I try logging=trace not to affect. How to print the details for log rotating cost in openJDK11 now (with xlog options)?

kimmking
  • 1
  • 3

1 Answers1

0

As a part of JEP 271 implementation, the log rotation was moved out of safepoints since JDK 9. So, it cannot be a direct reason of a long safepoint pause, and there is no more option to print GC log rotation times.

Seems like this is an XY Problem, and your original issue is the long pauses rather than printing log ration costs.

async-profiler can help in finding the cause of long pauses. Run it in the wall-clock mode (-e wall) with jfr output. It also has time-to-safepoint profiling option (--ttsp) specifically for detecting reasons why it takes long for the JVM to reach a safepoint. See the related question.

apangin
  • 92,924
  • 10
  • 193
  • 247