Skip to content

Commit d3073b5

Browse files
author
William Kemper
committed
8385610: Shenandoah: TestSoftMaxHeapSizeAvailableCalc should have more tolerance for other GC triggers
Reviewed-by: kdnilsen, xpeng, syan, ruili
1 parent 6e07965 commit d3073b5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

test/hotspot/jtreg/gc/shenandoah/TestSoftMaxHeapSizeAvailableCalc.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* -XX:ShenandoahGCMode=satb
3636
* -XX:+ShenandoahDegeneratedGC
3737
* -XX:ShenandoahGCHeuristics=adaptive
38+
* -XX:ShenandoahLearningSteps=0
3839
* TestSoftMaxHeapSizeAvailableCalc
3940
*/
4041

@@ -60,6 +61,7 @@
6061
* -XX:+UseShenandoahGC -Xlog:gc=info
6162
* -XX:ShenandoahGCMode=generational
6263
* -XX:ShenandoahGCHeuristics=adaptive
64+
* -XX:ShenandoahLearningSteps=0
6365
* TestSoftMaxHeapSizeAvailableCalc
6466
*
6567
*/
@@ -87,12 +89,13 @@ public static void main(String[] args) throws Exception {
8789
// Soft max: 512M, ShenandoahMinFreeThreshold: 10 (default), ShenandoahEvacReserve: 5 (default)
8890
// Soft max for mutator: 512M * (100.0 - 5) / 100 = 486.4M
8991
// Threshold to trigger gc: 486.4M - 512 * 10 / 100.0 = 435.2M, just above (300 + 100)M.
90-
// Expect gc count to be less than 1 / sec.
92+
// Expect gc count to be less than 1 / sec, but to allow for other trigger conditions (like allocation rate),
93+
// we bump the max allowed gc count to 35.
9194
public static class Allocate {
9295
static final List<byte[]> longLived = new ArrayList<>();
9396

9497
public static void test() throws Exception {
95-
final int expectedMaxGcCount = Integer.getInteger("expectedMaxGcCount", 30);
98+
final int expectedMaxGcCount = Integer.getInteger("expectedMaxGcCount", 35);
9699
List<java.lang.management.GarbageCollectorMXBean> collectors = ManagementFactory.getGarbageCollectorMXBeans();
97100
java.lang.management.GarbageCollectorMXBean cycleCollector = null;
98101
for (java.lang.management.GarbageCollectorMXBean bean : collectors) {

0 commit comments

Comments
 (0)