Skip to content

Commit

Permalink
Support generational ZGC in JvmGcMetrics
Browse files Browse the repository at this point in the history
Adds support for the newly released generational ZGC by including its names for GarbageCollectorMXBeans and MemoryPools in the corresponding logic used by JvmGcMetrics. Adds a new test task for running tests with generational ZGC and adds it to the CI build.

Resolves gh-4258
  • Loading branch information
shakuzen committed Oct 20, 2023
1 parent 0ec2909 commit c612de5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- gradlew-build
- run: ./gradlew shenandoahTest
- run: ./gradlew zgcTest
- run: ./gradlew zgcGenerationalTest

build-jdk11:
executor: circle-jdk11-executor
Expand Down
11 changes: 11 additions & 0 deletions micrometer-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,17 @@ task zgcTest(type: Test) {
jvmArgs '-XX:+UseZGC'
}

task zgcGenerationalTest(type: Test) {
// set heap size for the test JVM(s)
maxHeapSize = "1500m"

useJUnitPlatform {
includeTags 'gc'
}

jvmArgs '-XX:+UseZGC', '-XX:+ZGenerational'
}

task openj9BalancedTest(type: Test) {
// set heap size for the test JVM(s)
maxHeapSize = "1500m"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ enum GcGenerationAge {
put("GPGC Old Cycles", OLD); // new naming
put("GPGC New Pauses", YOUNG); // new naming
put("GPGC Old Pauses", OLD); // new naming
put("ZGC Major Cycles", OLD); // do not include 'ZGC Major Pauses'; see
// gh-2872
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ static boolean isConcurrentPhase(String cause, String name) {
}

static boolean isAllocationPool(String name) {
return name != null && (name.endsWith("Eden Space") || "Shenandoah".equals(name) || "ZHeap".equals(name)
return name != null && (name.endsWith("Eden Space") || "Shenandoah".equals(name) || "ZHeap".equals(name) // ZGC
// non-generational
|| "ZGC Young Generation".equals(name) // generational ZGC
|| name.endsWith("New Gen") // Zing GPGC
|| name.endsWith("nursery-allocate") || name.endsWith("-eden") // "balanced-eden"
|| "JavaHeap".equals(name) // metronome
Expand All @@ -51,9 +53,10 @@ static boolean isAllocationPool(String name) {

static boolean isLongLivedPool(String name) {
return name != null && (name.endsWith("Old Gen") || name.endsWith("Tenured Gen") || "Shenandoah".equals(name)
|| "ZHeap".equals(name) || name.endsWith("balanced-old") || name.contains("tenured") // "tenured",
// "tenured-SOA",
// "tenured-LOA"
|| "ZHeap".equals(name) // ZGC non-generational
|| "ZGC Old Generation".equals(name) // generational ZGC
|| name.endsWith("balanced-old") //
|| name.contains("tenured") // "tenured", "tenured-SOA", "tenured-LOA"
|| "JavaHeap".equals(name) // metronome
);
}
Expand Down

0 comments on commit c612de5

Please sign in to comment.