Skip to content

Commit b3fc013

Browse files
committed
8377143: Parallel: Remove special treatment in JstatGcCapacityResults.java
Reviewed-by: kevinw, tschatzl
1 parent a8a88d7 commit b3fc013

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -88,18 +88,11 @@ public void assertConsistency() {
8888
assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)");
8989

9090
// Verify relative size of NGC and S0C + S1C + EC.
91-
// The rule depends on if the tenured GC is parallel or not.
92-
// For parallell GC: NGC >= S0C + S1C + EC
93-
// For non-parallell GC: NGC == S0C + S1C + EC
94-
boolean isTenuredParallelGC = isTenuredParallelGC();
91+
// NGC == S0C + S1C + EC
9592
String errMsg = String.format(
96-
"NGC %s (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)",
97-
isTenuredParallelGC ? "<" : "!=", NGC, S0C, S1C, EC, S0C + S1C + EC);
98-
if (isTenuredParallelGC) {
99-
assertThat(NGC >= S0C + S1C + EC, errMsg);
100-
} else {
101-
assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg);
102-
}
93+
"NGC != (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)",
94+
NGC, S0C, S1C, EC, S0C + S1C + EC);
95+
assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg);
10396

10497
// Check Old Gen consistency
10598
float OGCMN = getFloatValue("OGCMN");
@@ -121,23 +114,4 @@ public void assertConsistency() {
121114
assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)");
122115
assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)");
123116
}
124-
125-
/**
126-
* Check if the tenured generation are currently using a parallel GC.
127-
*/
128-
protected static boolean isTenuredParallelGC() {
129-
// Currently the only parallel GC for the tenured generation is PS MarkSweep.
130-
List<String> parallelGCs = Arrays.asList(new String[] { "PS MarkSweep"});
131-
try {
132-
List<GarbageCollectorMXBean> beans = ManagementFactory.getGarbageCollectorMXBeans();
133-
for (GarbageCollectorMXBean bean : beans) {
134-
if (parallelGCs.contains(bean.getName())) {
135-
return true;
136-
}
137-
}
138-
} catch (Exception e) {
139-
e.printStackTrace();
140-
}
141-
return false;
142-
}
143117
}

0 commit comments

Comments
 (0)