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