76 * TestAllocHumongousFragment
77 *
78 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
79 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
80 * -XX:+ShenandoahVerify
81 * TestAllocHumongousFragment
82 *
83 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
84 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
85 * TestAllocHumongousFragment
86 *
87 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
88 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
89 * TestAllocHumongousFragment
90 *
91 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
92 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
93 * TestAllocHumongousFragment
94 */
95
96 import java.util.*;
97 import java.util.concurrent.*;
98
99 public class TestAllocHumongousFragment {
100
101 static final long TARGET_MB = Long.getLong("target", 30_000); // 30 Gb allocations
102 static final long LIVE_MB = Long.getLong("occupancy", 700); // 700 Mb alive
103
104 static volatile Object sink;
105
106 static List<int[]> objects;
107
108 public static void main(String[] args) throws Exception {
109 final int min = 128 * 1024;
110 final int max = 16 * 1024 * 1024;
111 final long count = TARGET_MB * 1024 * 1024 / (16 + 4 * (min + (max - min) / 2));
112
113 objects = new ArrayList<>();
114 long current = 0;
115
|
76 * TestAllocHumongousFragment
77 *
78 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
79 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
80 * -XX:+ShenandoahVerify
81 * TestAllocHumongousFragment
82 *
83 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
84 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
85 * TestAllocHumongousFragment
86 *
87 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
88 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
89 * TestAllocHumongousFragment
90 *
91 * @run main/othervm -Xmx1g -Xms1g -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahTargetNumRegions=2048
92 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
93 * TestAllocHumongousFragment
94 */
95
96 /*
97 * @test TestAllocHumongousFragment
98 * @summary Make sure Shenandoah can recover from humongous allocation fragmentation
99 * @key gc
100 * @requires vm.gc.Shenandoah & !vm.graal.enabled
101 *
102 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
103 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
104 * -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
105 * TestAllocHumongousFragment
106 *
107 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
108 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
109 * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
110 * TestAllocHumongousFragment
111 *
112 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
113 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
114 * -XX:+ShenandoahOOMDuringEvacALot
115 * TestAllocHumongousFragment
116 *
117 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
118 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
119 * -XX:+ShenandoahAllocFailureALot
120 * TestAllocHumongousFragment
121 *
122 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
123 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
124 * -XX:+ShenandoahVerify
125 * TestAllocHumongousFragment
126 *
127 * @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
128 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
129 * TestAllocHumongousFragment
130 */
131
132 import java.util.*;
133 import java.util.concurrent.*;
134
135 public class TestAllocHumongousFragment {
136
137 static final long TARGET_MB = Long.getLong("target", 30_000); // 30 Gb allocations
138 static final long LIVE_MB = Long.getLong("occupancy", 700); // 700 Mb alive
139
140 static volatile Object sink;
141
142 static List<int[]> objects;
143
144 public static void main(String[] args) throws Exception {
145 final int min = 128 * 1024;
146 final int max = 16 * 1024 * 1024;
147 final long count = TARGET_MB * 1024 * 1024 / (16 + 4 * (min + (max - min) / 2));
148
149 objects = new ArrayList<>();
150 long current = 0;
151
|