|
35 | 35 | * -XX:ShenandoahGCMode=satb |
36 | 36 | * -XX:+ShenandoahDegeneratedGC |
37 | 37 | * -XX:ShenandoahGCHeuristics=adaptive |
| 38 | + * -XX:ShenandoahLearningSteps=0 |
38 | 39 | * TestSoftMaxHeapSizeAvailableCalc |
39 | 40 | */ |
40 | 41 |
|
|
60 | 61 | * -XX:+UseShenandoahGC -Xlog:gc=info |
61 | 62 | * -XX:ShenandoahGCMode=generational |
62 | 63 | * -XX:ShenandoahGCHeuristics=adaptive |
| 64 | + * -XX:ShenandoahLearningSteps=0 |
63 | 65 | * TestSoftMaxHeapSizeAvailableCalc |
64 | 66 | * |
65 | 67 | */ |
@@ -87,12 +89,13 @@ public static void main(String[] args) throws Exception { |
87 | 89 | // Soft max: 512M, ShenandoahMinFreeThreshold: 10 (default), ShenandoahEvacReserve: 5 (default) |
88 | 90 | // Soft max for mutator: 512M * (100.0 - 5) / 100 = 486.4M |
89 | 91 | // 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. |
91 | 94 | public static class Allocate { |
92 | 95 | static final List<byte[]> longLived = new ArrayList<>(); |
93 | 96 |
|
94 | 97 | public static void test() throws Exception { |
95 | | - final int expectedMaxGcCount = Integer.getInteger("expectedMaxGcCount", 30); |
| 98 | + final int expectedMaxGcCount = Integer.getInteger("expectedMaxGcCount", 35); |
96 | 99 | List<java.lang.management.GarbageCollectorMXBean> collectors = ManagementFactory.getGarbageCollectorMXBeans(); |
97 | 100 | java.lang.management.GarbageCollectorMXBean cycleCollector = null; |
98 | 101 | for (java.lang.management.GarbageCollectorMXBean bean : collectors) { |
|
0 commit comments