Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/TestAllocObjects.java
32284 views
1
/*
2
* Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
3
*
4
* This code is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 only, as
6
* published by the Free Software Foundation.
7
*
8
* This code is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11
* version 2 for more details (a copy is included in the LICENSE file that
12
* accompanied this code).
13
*
14
* You should have received a copy of the GNU General Public License version
15
* 2 along with this work; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*
18
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19
* or visit www.oracle.com if you need additional information or have any
20
* questions.
21
*
22
*/
23
24
/*
25
* @test TestAllocObjects
26
* @summary Acceptance tests: collector can withstand allocation
27
* @key gc
28
*
29
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
30
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
31
* -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify
32
* TestAllocObjects
33
*
34
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
35
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
36
* -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify
37
* TestAllocObjects
38
*
39
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
40
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
41
* -XX:+ShenandoahDegeneratedGC
42
* TestAllocObjects
43
*
44
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
45
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
46
* -XX:-ShenandoahDegeneratedGC
47
* TestAllocObjects
48
*/
49
50
/*
51
* @test TestAllocObjects
52
* @summary Acceptance tests: collector can withstand allocation
53
* @key gc
54
*
55
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
56
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
57
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
58
* TestAllocObjects
59
*
60
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
61
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
62
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
63
* TestAllocObjects
64
*
65
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
66
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
67
* -XX:+ShenandoahOOMDuringEvacALot
68
* TestAllocObjects
69
*
70
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
71
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
72
* -XX:+ShenandoahAllocFailureALot
73
* TestAllocObjects
74
*
75
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
76
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
77
* TestAllocObjects
78
*
79
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
80
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
81
* -XX:+ShenandoahVerify
82
* TestAllocObjects
83
*
84
*/
85
86
/*
87
* @test TestAllocObjects
88
* @summary Acceptance tests: collector can withstand allocation
89
* @key gc
90
*
91
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
92
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
93
* TestAllocObjects
94
*
95
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
96
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
97
* TestAllocObjects
98
*/
99
100
/*
101
* @test TestAllocObjects
102
* @summary Acceptance tests: collector can withstand allocation
103
* @key gc
104
*
105
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
106
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
107
* TestAllocObjects
108
*/
109
110
/*
111
* @test TestAllocObjects
112
* @summary Acceptance tests: collector can withstand allocation
113
* @key gc
114
*
115
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
116
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
117
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
118
* TestAllocObjects
119
*/
120
121
/*
122
* @test TestAllocObjects
123
* @summary Acceptance tests: collector can withstand allocation
124
* @key gc
125
*
126
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
127
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
128
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
129
* TestAllocObjects
130
*
131
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
132
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
133
* -XX:+ShenandoahOOMDuringEvacALot
134
* TestAllocObjects
135
*
136
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
137
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
138
* -XX:+ShenandoahAllocFailureALot
139
* TestAllocObjects
140
*
141
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
142
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
143
* TestAllocObjects
144
*/
145
146
/*
147
* @test TestAllocObjects
148
* @summary Acceptance tests: collector can withstand allocation
149
* @key gc
150
*
151
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
152
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
153
* -XX:+ShenandoahVerify
154
* TestAllocObjects
155
*
156
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
157
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
158
* TestAllocObjects
159
*/
160
161
import java.util.Random;
162
163
public class TestAllocObjects {
164
165
static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
166
167
static volatile Object sink;
168
169
public static void main(String[] args) throws Exception {
170
long count = TARGET_MB * 1024 * 1024 / 16;
171
for (long c = 0; c < count; c++) {
172
sink = new Object();
173
}
174
}
175
176
}
177
178