简体   繁体   中英

How to print gc log rotating cost in openjdk11?

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)?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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