24
24
package gc .g1 ;
25
25
26
26
/*
27
- * @test TestMixedGCLiveThreshold
28
- * @summary Test G1MixedGCLiveThresholdPercent. Fill up a region to at least 1/3 region-size ,
29
- * the region should not be selected for mixed GC cycle if liveness is above threshold .
27
+ * @test id=0percent
28
+ * @summary Test G1MixedGCLiveThresholdPercent=0 . Fill up a region to at least 33 percent ,
29
+ * the region should not be selected for mixed GC cycle.
30
30
* @requires vm.gc.G1
31
31
* @library /test/lib
32
32
* @build sun.hotspot.WhiteBox
33
33
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
34
- * @run driver gc.g1.TestMixedGCLiveThreshold
34
+ * @run driver gc.g1.TestMixedGCLiveThreshold 0 false
35
+ */
36
+
37
+ /*
38
+ * @test id=25percent
39
+ * @summary Test G1MixedGCLiveThresholdPercent=25. Fill up a region to at least 33 percent,
40
+ * the region should not be selected for mixed GC cycle.
41
+ * @requires vm.gc.G1
42
+ * @library /test/lib
43
+ * @build sun.hotspot.WhiteBox
44
+ * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
45
+ * @run driver gc.g1.TestMixedGCLiveThreshold 25 false
46
+ */
47
+
48
+ /*
49
+ * @test id=100percent
50
+ * @summary Test G1MixedGCLiveThresholdPercent=100. Fill up a region to at least 33 percent,
51
+ * the region should be selected for mixed GC cycle.
52
+ * @requires vm.gc.G1
53
+ * @library /test/lib
54
+ * @build sun.hotspot.WhiteBox
55
+ * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
56
+ * @run driver gc.g1.TestMixedGCLiveThreshold 100 true
35
57
*/
36
58
37
59
import java .util .ArrayList ;
@@ -48,14 +70,9 @@ public class TestMixedGCLiveThreshold {
48
70
private static final String pattern = "Remembered Set Tracking update regions total ([0-9]+), selected ([0-9]+)$" ;
49
71
50
72
public static void main (String [] args ) throws Exception {
51
- // -XX:G1MixedGCLiveThresholdPercent=0
52
- testMixedGCLiveThresholdPercent (0 , false );
53
-
54
- // -XX:G1MixedGCLiveThresholdPercent=25
55
- testMixedGCLiveThresholdPercent (25 , false );
56
-
57
- // -XX:G1MixedGCLiveThresholdPercent=100
58
- testMixedGCLiveThresholdPercent (100 , true );
73
+ int liveThresholdPercent = Integer .parseInt (args [0 ]);
74
+ boolean expectRebuild = Boolean .parseBoolean (args [1 ]);
75
+ testMixedGCLiveThresholdPercent (liveThresholdPercent , expectRebuild );
59
76
}
60
77
61
78
private static void testMixedGCLiveThresholdPercent (int liveThresholdPercent , boolean expectedRebuild ) throws Exception {
@@ -71,6 +88,7 @@ private static void testMixedGCLiveThresholdPercent(int liveThresholdPercent, bo
71
88
" no regions should be selected" )
72
89
);
73
90
output .shouldHaveExitValue (0 );
91
+ output .reportDiagnosticSummary ();
74
92
}
75
93
76
94
private static OutputAnalyzer testWithMixedGCLiveThresholdPercent (int percent ) throws Exception {
0 commit comments