Skip to content

Commit

Permalink
Compatibility with generational ZGC (#1006)
Browse files Browse the repository at this point in the history
Generational ZGC splits the collector names into major/minor
cycles/pauses.
  • Loading branch information
DanielThomas authored Nov 18, 2022
1 parent a8faf40 commit 669c362
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,9 @@ private boolean isConcurrentPhase(GarbageCollectionNotificationInfo info) {
// https://bugs.openjdk.java.net/browse/JDK-8265136
//
// For ZGC in older versions, there is no way to accurately get the amount of time
// in STW pauses. The allocation stall seems to indicate that some thread
// or threads are blocked trying to allocate. Even though it is not a true STW pause,
// counting it as such seems to be less confusing.
return "No GC".equals(info.getGcCause()) // CMS
|| "Shenandoah Cycles".equals(info.getGcName()) // Shenandoah
|| "ZGC Cycles".equals(info.getGcName()) // ZGC in jdk17+
|| ("ZGC".equals(info.getGcName()) && !"Allocation Stall".equals(info.getGcCause()));
// in STW pauses.
return "No GC".equals(info.getGcCause()) // CMS
|| info.getGcName().endsWith(" Cycles"); // Shenandoah, ZGC
}

private class GcNotificationListener implements NotificationListener {
Expand Down

0 comments on commit 669c362

Please sign in to comment.