Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_modron_startup/mmparseXgc.cpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2021 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
*******************************************************************************/
23
24
/**
25
* @file
26
* @ingroup GC_Modron_Startup
27
*/
28
29
static const char *versionString = "Modron $Name: not supported by cvs2svn $";
30
31
#include "j9.h"
32
#include "j9cfg.h"
33
#include "j9protos.h"
34
#include "j9consts.h"
35
#include "jni.h"
36
#include "jvminit.h"
37
#include "j9port.h"
38
#include "modronnls.h"
39
#include "gcutils.h"
40
41
#include "mmparse.h"
42
43
#include "GCExtensions.hpp"
44
#include "Math.hpp"
45
46
/**
47
* Consume arguments found in the -Xgc: (gc_colon) argument list.
48
* @params scan_start address of the pointer to the string to parse
49
* @return 0 if there was an error parsing
50
* @return 1 if parsing was successful
51
* @return 2 if the option was not handled
52
*/
53
static UDATA
54
j9gc_initialize_parse_gc_colon(J9JavaVM *javaVM, char **scan_start)
55
{
56
MM_GCExtensions *extensions = MM_GCExtensions::getExtensions(javaVM);
57
PORT_ACCESS_FROM_JAVAVM(javaVM);
58
59
#if defined(J9VM_GC_THREAD_LOCAL_HEAP)
60
if(try_scan(scan_start, "tlhInitialSize=")) {
61
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhInitialSize, "tlhInitialSize=")) {
62
goto _error;
63
}
64
goto _exit;
65
}
66
if(try_scan(scan_start, "tlhMinimumSize=")) {
67
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhMinimumSize, "tlhMinimumSize=")) {
68
goto _error;
69
}
70
goto _exit;
71
}
72
if(try_scan(scan_start, "tlhMaximumSize=")) {
73
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhMaximumSize, "tlhMaximumSize=")) {
74
goto _error;
75
}
76
goto _exit;
77
}
78
if(try_scan(scan_start, "tlhIncrementSize=")) {
79
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhIncrementSize, "tlhIncrementSize=")) {
80
goto _error;
81
}
82
goto _exit;
83
}
84
if(try_scan(scan_start, "tlhSurvivorDiscardThreshold=")) {
85
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhSurvivorDiscardThreshold, "tlhSurvivorDiscardThreshold=")) {
86
goto _error;
87
}
88
goto _exit;
89
}
90
if(try_scan(scan_start, "tlhTenureDiscardThreshold=")) {
91
if(!scan_udata_helper(javaVM, scan_start, &extensions->tlhTenureDiscardThreshold, "tlhTenureDiscardThreshold=")) {
92
goto _error;
93
}
94
goto _exit;
95
}
96
97
#endif /* defined(J9VM_GC_THREAD_LOCAL_HEAP) */
98
#if defined(J9VM_GC_SEGREGATED_HEAP)
99
if(try_scan(scan_start, "allocationCacheMinimumSize=")) {
100
if(!scan_udata_helper(javaVM, scan_start, &extensions->allocationCacheMinimumSize, "allocationCacheMinimumSize=")) {
101
goto _error;
102
}
103
goto _exit;
104
}
105
if(try_scan(scan_start, "allocationCacheMaximumSize=")) {
106
if(!scan_udata_helper(javaVM, scan_start, &extensions->allocationCacheMaximumSize, "allocationCacheMaximumSize=")) {
107
goto _error;
108
}
109
goto _exit;
110
}
111
if(try_scan(scan_start, "allocationCacheInitialSize=")) {
112
if(!scan_udata_helper(javaVM, scan_start, &extensions->allocationCacheInitialSize, "allocationCacheInitialSize=")) {
113
goto _error;
114
}
115
goto _exit;
116
}
117
if(try_scan(scan_start, "allocationCacheIncrementSize=")) {
118
if(!scan_udata_helper(javaVM, scan_start, &extensions->allocationCacheIncrementSize, "allocationCacheMaximumSize=")) {
119
goto _error;
120
}
121
goto _exit;
122
}
123
#endif /* defined(J9VM_GC_SEGREGATED_HEAP) */
124
125
126
#if defined(J9VM_GC_REALTIME)
127
if (try_scan(scan_start, "synchronousGCOnOOM")) {
128
extensions->synchronousGCOnOOM = true;
129
goto _exit;
130
}
131
132
if (try_scan(scan_start, "noSynchronousGCOnOOM")) {
133
extensions->synchronousGCOnOOM = false;
134
goto _exit;
135
}
136
if (try_scan(scan_start, "targetUtilization=")) {
137
if(!scan_udata_helper(javaVM, scan_start, &(extensions->targetUtilizationPercentage), "targetUtilization=")) {
138
goto _error;
139
}
140
if ((extensions->targetUtilizationPercentage < 1) || (99 < extensions->targetUtilizationPercentage)) {
141
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "targetUtilization=", (UDATA)1, (UDATA)99);
142
goto _error;
143
}
144
goto _exit;
145
}
146
if (try_scan(scan_start, "threads=")) {
147
if(!scan_udata_helper(javaVM, scan_start, &(extensions->gcThreadCount), "threads=")) {
148
goto _error;
149
}
150
151
if(0 == extensions->gcThreadCount) {
152
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "threads=", (UDATA)0);
153
goto _error;
154
}
155
156
extensions->gcThreadCountForced = true;
157
goto _exit;
158
}
159
if(try_scan(scan_start, "noClassGC")) {
160
/* Metronome currently does not unload classes */
161
/* We do not care if this option is set or not, but if it is, it is just silently parsed */
162
goto _exit;
163
}
164
165
if (try_scan(scan_start, "overrideHiresTimerCheck")) {
166
extensions->overrideHiresTimerCheck = true;
167
goto _exit;
168
}
169
170
#endif /* J9VM_GC_REALTIME */
171
172
#if defined(J9VM_GC_REALTIME)|| defined(J9VM_GC_VLHGC)
173
if (try_scan(scan_start, "targetPausetime=")) {
174
/* the unit of target pause time option is in milliseconds */
175
UDATA beatMilli = 0;
176
if(!scan_udata_helper(javaVM, scan_start, &beatMilli, "targetPausetime=")) {
177
goto _error;
178
}
179
if(0 == beatMilli) {
180
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "targetPausetime=", (UDATA)0);
181
goto _error;
182
}
183
184
#if defined(J9VM_GC_REALTIME)
185
/* convert the unit to microseconds and store in extensions */
186
extensions->beatMicro = beatMilli * 1000;
187
#endif /* J9VM_GC_REALTIME */
188
189
#if defined(J9VM_GC_VLHGC)
190
/* Save soft pause target for balanced */
191
extensions->tarokTargetMaxPauseTime = beatMilli;
192
#endif /* J9VM_GC_VLHGC */
193
194
goto _exit;
195
}
196
#endif /* J9VM_GC_REALTIME || J9VM_GC_VLHGC */
197
198
//todo temporary option to allow LOA to be enabled for testing with non-default gc policies
199
//Remove once LOA code stable
200
#if defined(J9VM_GC_LARGE_OBJECT_AREA)
201
202
if(try_scan(scan_start, "largeObjectMinimumSize=")) {
203
UDATA value;
204
if(!scan_udata_helper(javaVM, scan_start, &value, "largeObjectMinimumSize=")) {
205
goto _error;
206
}
207
208
extensions->largeObjectMinimumSize = MM_Math::roundToCeiling(extensions->heapAlignment, value);
209
210
goto _exit;
211
}
212
213
if(try_scan(scan_start, "debugLOAFreelist")) {
214
extensions->debugLOAFreelist = true;
215
goto _exit;
216
}
217
218
if(try_scan(scan_start, "debugLOAAllocate")) {
219
extensions->debugLOAAllocate = true;
220
goto _exit;
221
}
222
223
#endif /* J9VM_GC_LARGE_OBJECT_AREA) */
224
225
226
if(try_scan(scan_start, "threadCount=")) {
227
if(!scan_udata_helper(javaVM, scan_start, &extensions->gcThreadCount, "threadCount=")) {
228
goto _error;
229
}
230
231
if(0 == extensions->gcThreadCount) {
232
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "threadCount=", (UDATA)0);
233
goto _error;
234
}
235
236
extensions->gcThreadCountForced = true;
237
goto _exit;
238
}
239
240
if (try_scan(scan_start, "snapshotAtTheBeginningBarrier")) {
241
extensions->configurationOptions._forceOptionWriteBarrierSATB = true;
242
goto _exit;
243
}
244
245
#if defined(J9VM_GC_MODRON_SCAVENGER)
246
247
if(try_scan(scan_start, "tenureBytesDeviationBoost=")) {
248
UDATA value;
249
if(!scan_udata_helper(javaVM, scan_start, &value, "tenureBytesDeviationBoost=")) {
250
goto _error;
251
}
252
253
extensions->tenureBytesDeviationBoost = value / (float)10.0;
254
goto _exit;
255
}
256
257
if(try_scan(scan_start, "scavenge")) {
258
extensions->configurationOptions._forceOptionScavenge = true;
259
extensions->scavengerEnabled = true;
260
goto _exit;
261
}
262
263
if(try_scan(scan_start, "noScavenge")) {
264
extensions->configurationOptions._forceOptionScavenge = true;
265
extensions->scavengerEnabled = false;
266
goto _exit;
267
}
268
269
if(try_scan(scan_start, "concurrentKickoffTenuringHeadroom=")) {
270
UDATA value = 0;
271
if(!scan_udata_helper(javaVM, scan_start, &value, "concurrentKickoffTenuringHeadroom=")) {
272
goto _error;
273
}
274
if(value > 100) {
275
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "concurrentKickoffTenuringHeadroom=", (UDATA)0, (UDATA)100);
276
goto _error;
277
}
278
extensions->concurrentKickoffTenuringHeadroom = ((float)value) / 100.0f;
279
goto _exit;
280
}
281
282
283
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
284
/* Parsing of concurrentScavengeBackground/Slack must happen before concurrentScavenge, since the later option is a substring of the former(s).
285
* However, there is no effective limitation on relative order of these options in a command line. */
286
if(try_scan(scan_start, "concurrentScavengeSlack=")) {
287
if(!scan_udata_helper(javaVM, scan_start, &extensions->concurrentScavengerSlack, "concurrentScavengeSlack=")) {
288
goto _error;
289
}
290
goto _exit;
291
}
292
293
if(try_scan(scan_start, "concurrentScavengeAllocDeviationBoost=")) {
294
UDATA value;
295
if(!scan_udata_helper(javaVM, scan_start, &value, "concurrentScavengeAllocDeviationBoost=")) {
296
goto _error;
297
}
298
299
extensions->concurrentScavengerAllocDeviationBoost = value / (float)10.0;
300
goto _exit;
301
}
302
303
if(try_scan(scan_start, "concurrentScavengeBackground=")) {
304
if(!scan_udata_helper(javaVM, scan_start, &extensions->concurrentScavengerBackgroundThreads, "concurrentScavengeBackground=")) {
305
goto _error;
306
}
307
extensions->concurrentScavengerBackgroundThreadsForced = true;
308
goto _exit;
309
}
310
/* Must be parsed after concurrentScavengeBackground/Slack. */
311
if(try_scan(scan_start, "concurrentScavenge")) {
312
extensions->concurrentScavengerForced = true;
313
goto _exit;
314
}
315
316
if(try_scan(scan_start, "noConcurrentScavenge")) {
317
extensions->concurrentScavengerForced = false;
318
goto _exit;
319
}
320
#endif /* OMR_GC_CONCURRENT_SCAVENGER */
321
322
if(try_scan(scan_start, "failedTenureThreshold=")) {
323
if(!scan_udata_helper(javaVM, scan_start, &extensions->scavengerFailedTenureThreshold, "failedTenureThreshold=")) {
324
goto _error;
325
}
326
goto _exit;
327
}
328
329
if(try_scan(scan_start, "maxScavengeBeforeGlobal=")) {
330
if(!scan_udata_helper(javaVM, scan_start, &extensions->maxScavengeBeforeGlobal, "maxScavengeBeforeGlobal=")) {
331
goto _error;
332
}
333
goto _exit;
334
}
335
336
if(try_scan(scan_start, "scvCollectorExpandRatio=")) {
337
UDATA value;
338
if(!scan_udata_helper(javaVM, scan_start, &value, "scvCollectorExpandRatio=")) {
339
goto _error;
340
}
341
if((0 == value) || (100 < value)) {
342
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvCollectorExpandRatio=", (UDATA)1, (UDATA)100);
343
}
344
345
extensions->scavengerCollectorExpandRatio = value / (double)100.0;
346
goto _exit;
347
}
348
349
if(try_scan(scan_start, "scvMaximumCollectorExpandSize=")) {
350
UDATA value;
351
if(!scan_udata_helper(javaVM, scan_start, &value, "scvMaximumCollectorExpandSize=")) {
352
goto _error;
353
}
354
355
extensions->scavengerMaximumCollectorExpandSize = MM_Math::roundToCeiling(extensions->heapAlignment, value);
356
goto _exit;
357
}
358
359
if (try_scan(scan_start, "scvTenureStrategy=")) {
360
/* Reset all tenure strategies because we will be setting them explicitly now. */
361
extensions->scvTenureStrategyFixed = false;
362
extensions->scvTenureStrategyAdaptive = false;
363
extensions->scvTenureStrategyLookback = false;
364
extensions->scvTenureStrategyHistory = false;
365
366
/* Scan all desired tenure strategies. */
367
do {
368
if (try_scan(scan_start, "fixed")) {
369
extensions->scvTenureStrategyFixed = true;
370
} else if (try_scan(scan_start, "adaptive")) {
371
extensions->scvTenureStrategyAdaptive = true;
372
} else if (try_scan(scan_start, "lookback")) {
373
extensions->scvTenureStrategyLookback = true;
374
} else if (try_scan(scan_start, "history")) {
375
extensions->scvTenureStrategyHistory = true;
376
} else {
377
/* TODO: Add NLS error message once message promotes through VM silo. */
378
goto _error;
379
}
380
} while (try_scan(scan_start, "+"));
381
goto _exit;
382
}
383
384
if(try_scan(scan_start, "scvTenureSurvivalThreshold=")) {
385
UDATA value;
386
if(!scan_udata_helper(javaVM, scan_start, &value, "scvTenureSurvivalThreshold=")) {
387
goto _error;
388
}
389
if(value > 100) {
390
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvTenureSurvivalThreshold=", (UDATA)0, (UDATA)100);
391
goto _error;
392
}
393
extensions->scvTenureStrategySurvivalThreshold = ((double)value) / 100.0;
394
goto _exit;
395
}
396
397
#if defined(J9VM_GC_ADAPTIVE_TENURING)
398
if(try_scan(scan_start, "adaptiveTenure")) {
399
extensions->scvTenureStrategyAdaptive = true;
400
goto _exit;
401
}
402
403
if(try_scan(scan_start, "noAdaptiveTenure")) {
404
extensions->scvTenureStrategyFixed = true;
405
extensions->scvTenureStrategyAdaptive = false;
406
extensions->scvTenureStrategyLookback = false;
407
extensions->scvTenureStrategyHistory = false;
408
goto _exit;
409
}
410
411
if(try_scan(scan_start, "tenureAge=")) {
412
UDATA tenureAge = 0;
413
if(!scan_udata_helper(javaVM, scan_start, &tenureAge, "tenureAge=")) {
414
goto _error;
415
}
416
if((tenureAge > OBJECT_HEADER_AGE_MAX) || (tenureAge < OBJECT_HEADER_AGE_MIN)) {
417
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "tenureAge=", (UDATA)OBJECT_HEADER_AGE_MIN, (UDATA)OBJECT_HEADER_AGE_MAX);
418
goto _error;
419
}
420
extensions->scvTenureAdaptiveTenureAge = tenureAge;
421
extensions->scvTenureFixedTenureAge = tenureAge;
422
goto _exit;
423
}
424
425
if(try_scan(scan_start, "scvNoAdaptiveTenure")) {
426
extensions->scvTenureStrategyFixed = true;
427
extensions->scvTenureStrategyAdaptive = false;
428
extensions->scvTenureStrategyLookback = false;
429
extensions->scvTenureStrategyHistory = false;
430
goto _exit;
431
}
432
433
if(try_scan(scan_start, "scvTenureAge=")) {
434
UDATA tenureAge = 0;
435
if(!scan_udata_helper(javaVM, scan_start, &tenureAge, "scvTenureAge=")) {
436
goto _error;
437
}
438
if((tenureAge > OBJECT_HEADER_AGE_MAX) || (tenureAge < OBJECT_HEADER_AGE_MIN)) {
439
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvTenureAge=", (UDATA)OBJECT_HEADER_AGE_MIN, (UDATA)OBJECT_HEADER_AGE_MAX);
440
goto _error;
441
}
442
extensions->scvTenureAdaptiveTenureAge = tenureAge;
443
extensions->scvTenureFixedTenureAge = tenureAge;
444
goto _exit;
445
}
446
447
if(try_scan(scan_start, "scvAdaptiveTenureAge=")) {
448
UDATA adaptiveTenureAge = 0;
449
if(!scan_udata_helper(javaVM, scan_start, &adaptiveTenureAge, "scvAdaptiveTenureAge=")) {
450
goto _error;
451
}
452
if((adaptiveTenureAge > OBJECT_HEADER_AGE_MAX) || (adaptiveTenureAge < OBJECT_HEADER_AGE_MIN)) {
453
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvAdaptiveTenureAge=", (UDATA)OBJECT_HEADER_AGE_MIN, (UDATA)OBJECT_HEADER_AGE_MAX);
454
goto _error;
455
}
456
extensions->scvTenureAdaptiveTenureAge = adaptiveTenureAge;
457
goto _exit;
458
}
459
460
if(try_scan(scan_start, "scvFixedTenureAge=")) {
461
UDATA fixedTenureAge = 0;
462
if(!scan_udata_helper(javaVM, scan_start, &fixedTenureAge, "scvFixedTenureAge=")) {
463
goto _error;
464
}
465
if((fixedTenureAge > OBJECT_HEADER_AGE_MAX) || (fixedTenureAge < OBJECT_HEADER_AGE_MIN)) {
466
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvFixedTenureAge=", (UDATA)OBJECT_HEADER_AGE_MIN, (UDATA)OBJECT_HEADER_AGE_MAX);
467
goto _error;
468
}
469
extensions->scvTenureFixedTenureAge = fixedTenureAge;
470
goto _exit;
471
}
472
473
if(try_scan(scan_start, "scvth=")) {
474
if(!scan_udata_helper(javaVM, scan_start, &extensions->scvTenureRatioHigh, "scvth=")) {
475
goto _error;
476
}
477
if(extensions->scvTenureRatioHigh > 100) {
478
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvth=", (UDATA)0, (UDATA)100);
479
goto _error;
480
}
481
goto _exit;
482
}
483
if(try_scan(scan_start, "scvtl=")) {
484
if(!scan_udata_helper(javaVM, scan_start, &extensions->scvTenureRatioLow, "scvtl=")) {
485
goto _error;
486
}
487
if(extensions->scvTenureRatioLow > 100) {
488
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvtl=", (UDATA)0, (UDATA)100);
489
goto _error;
490
}
491
goto _exit;
492
}
493
#endif /* J9VM_GC_ADAPTIVE_TENURING */
494
495
#if defined(J9VM_GC_TILTED_NEW_SPACE)
496
/* NOTE: the tilt ratio is specified as the percentage used by new space. This is consistent
497
* with what's printed in -verbose:gc and is intuitive. However we store these ratios internally
498
* as the percentage of survivor space. So a specified value of 30 is stored as 70.
499
*/
500
if(try_scan(scan_start, "scvTiltRatioMax=")) {
501
UDATA value;
502
if(!scan_udata_helper(javaVM, scan_start, &value, "scvTiltRatioMax=")) {
503
goto _error;
504
}
505
if((50 > value) || (90 < value)) {
506
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvTiltRatioMax=", (UDATA)50, (UDATA)90);
507
}
508
509
extensions->survivorSpaceMinimumSizeRatio = (100 - value) / (double)100.0;
510
goto _exit;
511
}
512
if(try_scan(scan_start, "scvTiltRatioMin=")) {
513
UDATA value;
514
if(!scan_udata_helper(javaVM, scan_start, &value, "scvTiltRatioMin=")) {
515
goto _error;
516
}
517
if((50 > value) || (90 < value)) {
518
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "scvTiltRatioMin=", (UDATA)50, (UDATA)90);
519
}
520
521
extensions->survivorSpaceMaximumSizeRatio = (100 - value) / (double)100.0;
522
goto _exit;
523
}
524
if(try_scan(scan_start, "scvTiltIncreaseMax=")) {
525
UDATA value;
526
if(!scan_udata_helper(javaVM, scan_start, &value, "scvTiltIncreaseMax=")) {
527
goto _error;
528
}
529
if(0 == value) {
530
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "scvTiltIncreaseMax=", (UDATA)0);
531
goto _error;
532
}
533
534
extensions->tiltedScavengeMaximumIncrease = value / (double)100.0;
535
goto _exit;
536
}
537
if(try_scan(scan_start, "scvDebugTiltedNursery")) {
538
extensions->debugTiltedScavenge = true;
539
goto _exit;
540
}
541
if(try_scan(scan_start, "scvTiltedNursery")) {
542
extensions->tiltedScavenge = true;
543
goto _exit;
544
}
545
if(try_scan(scan_start, "scvNoTiltedNursery")) {
546
extensions->tiltedScavenge = false;
547
goto _exit;
548
}
549
#endif /* J9VM_GC_TILTED_NEW_SPACE */
550
551
552
if(try_scan(scan_start, "noHeapExpansionAfterExpansionGCCount=")) {
553
UDATA value;
554
if(!scan_udata_helper(javaVM, scan_start, &value, "noHeapExpansionAfterExpansionGCCount=")) {
555
goto _error;
556
}
557
extensions->heapExpansionStabilizationCount = value;
558
goto _exit;
559
}
560
561
if(try_scan(scan_start, "noHeapContractionAfterExpansionGCCount=")) {
562
UDATA value;
563
if(!scan_udata_helper(javaVM, scan_start, &value, "noHeapContractionAfterExpansionGCCount=")) {
564
goto _error;
565
}
566
extensions->heapContractionStabilizationCount = value;
567
goto _exit;
568
}
569
570
if(try_scan(scan_start, "ignoreHeapStatsAfterHeapExpansion")) {
571
/* this is the same as setting these options to 3 -- the size of the heap stats */
572
extensions->heapExpansionStabilizationCount = 3;
573
extensions->heapContractionStabilizationCount = 3;
574
goto _exit;
575
}
576
577
#if defined(J9VM_GC_DYNAMIC_NEW_SPACE_SIZING)
578
if(try_scan(scan_start, "dynamicNewSpaceSizing")) {
579
extensions->dynamicNewSpaceSizing = true;
580
goto _exit;
581
}
582
583
if(try_scan(scan_start, "noDynamicNewSpaceSizing")) {
584
extensions->dynamicNewSpaceSizing = false;
585
goto _exit;
586
}
587
588
if(try_scan(scan_start, "debugDynamicNewSpaceSizing")) {
589
extensions->debugDynamicNewSpaceSizing = true;
590
goto _exit;
591
}
592
593
/* VMDESIGN 1690: (default) hint to try to avoid moving objects during dynamic new space resizing */
594
if(try_scan(scan_start, "dnssAvoidMovingObjects")) {
595
extensions->dnssAvoidMovingObjects = true;
596
goto _exit;
597
}
598
599
/* VMDESIGN 1690: use pre-Java 6 new space resizing policy */
600
if(try_scan(scan_start, "dnssNoAvoidMovingObjects")) {
601
extensions->dnssAvoidMovingObjects = false;
602
goto _exit;
603
}
604
605
if(try_scan(scan_start, "dnssMaximumContraction=")) {
606
UDATA value;
607
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssMaximumContraction=")) {
608
goto _error;
609
}
610
if(value > 100) {
611
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssMaximumContraction=", (UDATA)0, (UDATA)100);
612
goto _error;
613
}
614
extensions->dnssMaximumContraction = ((double)value) / ((double)100);
615
goto _exit;
616
}
617
618
if(try_scan(scan_start, "dnssMaximumExpansion=")) {
619
UDATA value;
620
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssMaximumExpansion=")) {
621
goto _error;
622
}
623
if(value > 100) {
624
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssMaximumExpansion=", (UDATA)0, (UDATA)100);
625
goto _error;
626
}
627
extensions->dnssMaximumExpansion = ((double)value) / ((double)100);
628
goto _exit;
629
}
630
631
if(try_scan(scan_start, "dnssMinimumContraction=")) {
632
UDATA value;
633
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssMinimumContraction=")) {
634
goto _error;
635
}
636
if(value > 100) {
637
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssMinimumContraction=", (UDATA)0, (UDATA)100);
638
goto _error;
639
}
640
extensions->dnssMinimumContraction = ((double)value) / ((double)100);
641
goto _exit;
642
}
643
644
if(try_scan(scan_start, "loaFreeHistorySize=")) {
645
UDATA value;
646
if(!scan_udata_helper(javaVM, scan_start, &value, "loaFreeHistorySize=")) {
647
goto _error;
648
}
649
if(value > 100) {
650
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "loaFreeHistorySize=", (UDATA)0, (UDATA)100);
651
goto _error;
652
}
653
extensions->loaFreeHistorySize = ((int)value);
654
goto _exit;
655
}
656
657
if(try_scan(scan_start, "dnssMinimumExpansion=")) {
658
UDATA value;
659
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssMinimumExpansion=")) {
660
goto _error;
661
}
662
if(value > 100) {
663
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssMinimumExpansion=", (UDATA)0, (UDATA)100);
664
goto _error;
665
}
666
extensions->dnssMinimumExpansion = ((double)value) / ((double)100);
667
goto _exit;
668
}
669
670
if(try_scan(scan_start, "dnssExpectedTimeRatioMinimum=")) {
671
UDATA value;
672
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssExpectedTimeRatioMinimum=")) {
673
goto _error;
674
}
675
if(value > 100) {
676
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssExpectedTimeRatioMinimum=", (UDATA)0, (UDATA)100);
677
goto _error;
678
}
679
extensions->dnssExpectedRatioMinimum._wasSpecified = true;
680
extensions->dnssExpectedRatioMinimum._valueSpecified = ((double)value) / ((double)100);
681
goto _exit;
682
}
683
684
if(try_scan(scan_start, "dnssExpectedTimeRatioMaximum=")) {
685
UDATA value;
686
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssExpectedTimeRatioMaximum=")) {
687
goto _error;
688
}
689
if(value > 100) {
690
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssExpectedTimeRatioMaximum=", (UDATA)0, (UDATA)100);
691
goto _error;
692
}
693
extensions->dnssExpectedRatioMaximum._wasSpecified = true;
694
extensions->dnssExpectedRatioMaximum._valueSpecified = ((double)value) / ((double)100);
695
goto _exit;
696
}
697
698
if(try_scan(scan_start, "dnssWeightedTimeRatioFactorIncreaseSmall=")) {
699
UDATA value;
700
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssWeightedTimeRatioFactorIncreaseSmall=")) {
701
goto _error;
702
}
703
if(value > 100) {
704
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssWeightedTimeRatioFactorIncreaseSmall=", (UDATA)0, (UDATA)100);
705
goto _error;
706
}
707
extensions->dnssWeightedTimeRatioFactorIncreaseSmall = ((double)value) / ((double)100);
708
goto _exit;
709
}
710
711
if(try_scan(scan_start, "dnssWeightedTimeRatioFactorIncreaseMedium=")) {
712
UDATA value;
713
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssWeightedTimeRatioFactorIncreaseMedium=")) {
714
goto _error;
715
}
716
if(value > 100) {
717
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssWeightedTimeRatioFactorIncreaseMedium=", (UDATA)0, (UDATA)100);
718
goto _error;
719
}
720
extensions->dnssWeightedTimeRatioFactorIncreaseMedium = ((double)value) / ((double)100);
721
goto _exit;
722
}
723
724
if(try_scan(scan_start, "dnssWeightedTimeRatioFactorIncreaseLarge=")) {
725
UDATA value;
726
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssWeightedTimeRatioFactorIncreaseLarge=")) {
727
goto _error;
728
}
729
if(value > 100) {
730
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssWeightedTimeRatioFactorIncreaseLarge=", (UDATA)0, (UDATA)100);
731
goto _error;
732
}
733
extensions->dnssWeightedTimeRatioFactorIncreaseLarge = ((double)value) / ((double)100);
734
goto _exit;
735
}
736
737
if(try_scan(scan_start, "dnssWeightedTimeRatioFactorDecrease=")) {
738
UDATA value;
739
if(!scan_udata_helper(javaVM, scan_start, &value, "dnssWeightedTimeRatioFactorDecrease=")) {
740
goto _error;
741
}
742
if(value > 100) {
743
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "dnssWeightedTimeRatioFactorDecrease=", (UDATA)0, (UDATA)100);
744
goto _error;
745
}
746
extensions->dnssWeightedTimeRatioFactorDecrease = ((double)value) / ((double)100);
747
goto _exit;
748
}
749
750
#endif /* J9VM_GC_DYNAMIC_NEW_SPACE_SIZING */
751
#endif /* J9VM_GC_MODRON_SCAVENGER */
752
753
if(try_scan(scan_start, "globalMaximumContraction=")) {
754
UDATA value;
755
if(!scan_udata_helper(javaVM, scan_start, &value, "globalMaximumContraction=")) {
756
goto _error;
757
}
758
if(value > 100) {
759
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "globalMaximumContraction=", (UDATA)0, (UDATA)100);
760
goto _error;
761
}
762
extensions->globalMaximumContraction = ((double)value) / ((double)100);
763
goto _exit;
764
}
765
766
if(try_scan(scan_start, "globalMinimumContraction=")) {
767
UDATA value;
768
if(!scan_udata_helper(javaVM, scan_start, &value, "globalMinimumContraction=")) {
769
goto _error;
770
}
771
if(value > 100) {
772
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "globalMinimumContraction=", (UDATA)0, (UDATA)100);
773
goto _error;
774
}
775
extensions->globalMinimumContraction = ((double)value) / ((double)100);
776
goto _exit;
777
}
778
779
/* Alternate option to set globalMaximumContraction */
780
if(try_scan(scan_start, "maxContractPercent=")) {
781
UDATA value;
782
if(!scan_udata_helper(javaVM, scan_start, &value, "maxContractPercent=")) {
783
goto _error;
784
}
785
if(value > 100) {
786
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "maxContractPercent=", (UDATA)0, (UDATA)100);
787
goto _error;
788
}
789
extensions->globalMaximumContraction = ((double)value) / ((double)100);
790
goto _exit;
791
}
792
793
/* Alternate option to set globalMinimumContraction */
794
if(try_scan(scan_start, "minContractPercent=")) {
795
UDATA value;
796
if(!scan_udata_helper(javaVM, scan_start, &value, "minContractPercent=")) {
797
goto _error;
798
}
799
if(value > 100) {
800
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "minContractPercent=", (UDATA)0, (UDATA)100);
801
goto _error;
802
}
803
extensions->globalMinimumContraction = ((double)value) / ((double)100);
804
goto _exit;
805
}
806
807
if(try_scan(scan_start, "excessiveGCdebug")) {
808
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_DEPRECATED, "-Xgc:excessiveGCdebug=", "-Xtgc:excessivegc");
809
goto _error;
810
}
811
812
if(try_scan(scan_start, "excessiveGCratio=")) {
813
UDATA value;
814
if(!scan_udata_helper(javaVM, scan_start, &value, "excessiveGCratio=")) {
815
goto _error;
816
}
817
if((value > 100) || (value < 10)) {
818
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "excessiveGCratio=", (UDATA)10, (UDATA)100);
819
goto _error;
820
}
821
extensions->excessiveGCratio = value;
822
goto _exit;
823
}
824
825
if(try_scan(scan_start, "excessiveGCFreeSizeRatio=")) {
826
UDATA value;
827
if(!scan_udata_helper(javaVM, scan_start, &value, "excessiveGCFreeSizeRatio=")) {
828
goto _error;
829
}
830
if(value > 100) {
831
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "excessiveGCFreeSizeRatio=", (UDATA)0, (UDATA)100);
832
goto _error;
833
}
834
extensions->excessiveGCFreeSizeRatio = ((float)value) / 100.0f;
835
goto _exit;
836
}
837
838
if(try_scan(scan_start, "excessiveGCnewRatioWeight=")) {
839
UDATA value;
840
if(!scan_udata_helper(javaVM, scan_start, &value, "excessiveGCnewRatioWeight=")) {
841
goto _error;
842
}
843
if((value < 1) || (value > 90)) {
844
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "excessiveGCnewRatioWeight=", (UDATA)1, (UDATA)90);
845
goto _error;
846
}
847
extensions->excessiveGCnewRatioWeight =((float)value) / 100.0f;
848
goto _exit;
849
}
850
851
#if defined(J9VM_GC_MODRON_COMPACTION)
852
if(try_scan(scan_start, "stdGlobalCompactToSatisfyAllocate")) {
853
extensions->compactToSatisfyAllocate = true;
854
goto _exit;
855
}
856
857
/* Incremental compaction is no longer supported.
858
* Options are supported but deprecated.
859
*/
860
if(try_scan(scan_start, "icompact=")) {
861
UDATA incrementalCompactSteps;
862
if(!scan_udata_helper(javaVM, scan_start, &incrementalCompactSteps, "icompact=")) {
863
goto _error;
864
}
865
goto _exit;
866
}
867
#endif /* J9VM_GC_MODRON_COMPACTION */
868
869
#if defined (OMR_GC_MODRON_CONCURRENT_MARK)
870
if(try_scan(scan_start, "concurrentMark")) {
871
extensions->configurationOptions._forceOptionConcurrentMark = true;
872
extensions->concurrentMark = true;
873
goto _exit;
874
}
875
876
if(try_scan(scan_start, "noConcurrentMarkKO")) {
877
extensions->concurrentKickoffEnabled = false;
878
goto _exit;
879
}
880
881
if(try_scan(scan_start, "concurrentSlack=")) {
882
883
/* if concurrentSlack=macrofrag is set, we will count estimateFragmentation when deciding concurrentgc kickoff , concurrentSlackFragmentationAdjustmentWeight is set as 1.0 as default */
884
if (try_scan(scan_start, "macrofrag")) {
885
extensions->estimateFragmentation = (GLOBALGC_ESTIMATE_FRAGMENTATION | LOCALGC_ESTIMATE_FRAGMENTATION);
886
extensions->processLargeAllocateStats = true;
887
extensions->concurrentSlackFragmentationAdjustmentWeight = 1.0;
888
goto _exit;
889
} else {
890
UDATA value;
891
if(!scan_udata_helper(javaVM, scan_start, &value, "concurrentSlack=")) {
892
goto _error;
893
}
894
extensions->concurrentSlack = value;
895
goto _exit;
896
}
897
}
898
899
if (try_scan(scan_start, "concurrentSlackFragmentationAdjustmentWeight=")) {
900
UDATA value;
901
if(!scan_udata_helper(javaVM, scan_start, &value, "concurrentSlackFragmentationAdjustmentWeight=")) {
902
goto _error;
903
}
904
if(value > 500) {
905
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "concurrentSlackFragmentationAdjustmentWeight==", (UDATA)0, (UDATA)500);
906
goto _error;
907
}
908
extensions->concurrentSlackFragmentationAdjustmentWeight = ((double)value) / 100.0;
909
goto _exit;
910
}
911
912
if(try_scan(scan_start, "noConcurrentMark")) {
913
extensions->configurationOptions._forceOptionConcurrentMark = true;
914
extensions->concurrentMark = false;
915
goto _exit;
916
}
917
918
if(try_scan(scan_start, "optimizeConcurrentWB")) {
919
extensions->optimizeConcurrentWB = true;
920
goto _exit;
921
}
922
923
if(try_scan(scan_start, "noOptimizeConcurrentWB")) {
924
extensions->optimizeConcurrentWB = false;
925
goto _exit;
926
}
927
928
if(try_scan(scan_start, "debugConcurrentMark")) {
929
extensions->debugConcurrentMark = true;
930
goto _exit;
931
}
932
933
if(try_scan(scan_start, "cardCleaningPasses=")) {
934
UDATA value;
935
if(!scan_udata_helper(javaVM, scan_start, &value, "cardCleaningPasses=")) {
936
goto _error;
937
}
938
if(value > 2) {
939
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "cardCleaningPasses=", (UDATA)0, (UDATA)2);
940
goto _error;
941
}
942
extensions->cardCleaningPasses = value;
943
goto _exit;
944
}
945
946
if(try_scan(scan_start, "cardCleanPass2Boost=")) {
947
if(!scan_udata_helper(javaVM, scan_start, &extensions->cardCleanPass2Boost, "cardCleanPass2Boost=")) {
948
goto _error;
949
}
950
goto _exit;
951
}
952
#endif /* OMR_GC_MODRON_CONCURRENT_MARK */
953
954
if(try_scan(scan_start, "version")) {
955
j9tty_printf(PORTLIB, "GC Version: %s\n", versionString);
956
goto _exit;
957
}
958
959
#if defined(J9VM_GC_BATCH_CLEAR_TLH)
960
if(try_scan(scan_start, "batchClearTLH")) {
961
extensions->batchClearTLH = 1;
962
goto _exit;
963
}
964
#endif /* J9VM_GC_BATCH_CLEAR_TLH */
965
966
#if defined(J9VM_GC_SUBPOOLS_ALIAS)
967
/*
968
* Temporary: Accept but silently ignore any subpool option
969
* subpool gc policy is not supported any more just it is an alias for optthruput
970
*/
971
if(try_scan(scan_start, "subPoolsDebug")) {
972
goto _exit;
973
}
974
975
if(try_scan(scan_start, "disableSubPoolLargeHeap")) {
976
goto _exit;
977
}
978
979
if(try_scan(scan_start, "microFragmentationDetectionThreshold=")) {
980
UDATA value;
981
if(!scan_udata_helper(javaVM, scan_start, &value, "microFragmentationDetectionThreshold=")) {
982
goto _error;
983
}
984
goto _exit;
985
}
986
987
if(try_scan(scan_start, "microFragmentationDetection")) {
988
goto _exit;
989
}
990
#endif /* defined(J9VM_GC_SUBPOOLS_ALIAS) */
991
992
#if defined(J9VM_GC_CONCURRENT_SWEEP)
993
if(try_scan(scan_start, "concurrentSweep")) {
994
extensions->configurationOptions._forceOptionConcurrentSweep = true;
995
extensions->concurrentSweep = true;
996
goto _exit;
997
}
998
999
if(try_scan(scan_start, "noConcurrentSweep")) {
1000
extensions->configurationOptions._forceOptionConcurrentSweep = true;
1001
extensions->concurrentSweep = false;
1002
goto _exit;
1003
}
1004
#endif /* J9VM_GC_CONCURRENT_SWEEP */
1005
1006
/* Additional -Xgc:fvtest options */
1007
if(try_scan(scan_start, "fvtest=")) {
1008
#if defined(J9VM_GC_MODRON_SCAVENGER) || defined(J9VM_GC_VLHGC)
1009
#if defined(J9VM_GC_MODRON_SCAVENGER)
1010
/* This option forces the scavenger to backout every other collect */
1011
if (try_scan(scan_start, "forceScavengerBackout")) {
1012
extensions->fvtest_forceScavengerBackout = true;
1013
goto _exit;
1014
}
1015
1016
/* This option forces the scavenger to poison evacuate space after every collection */
1017
if (try_scan(scan_start, "forcePoisonEvacuate")) {
1018
extensions->fvtest_forcePoisonEvacuate = true;
1019
goto _exit;
1020
}
1021
1022
/* This forces the nursery space to resize - 3 expands followed by 3 contracts */
1023
if (try_scan(scan_start, "forceNurseryResize")) {
1024
extensions->fvtest_forceNurseryResize = true;
1025
goto _exit;
1026
}
1027
1028
/* This forces the tenure space to resize - 5 expands followed by 5 contracts */
1029
if (try_scan(scan_start, "forceTenureResize")) {
1030
extensions->fvtest_forceOldResize = true;
1031
goto _exit;
1032
}
1033
#endif /* J9VM_GC_MODRON_SCAVENGER */
1034
1035
/* This takes a UDATA that restricts the number of scan caches - used to force scan cache overflow */
1036
if (try_scan(scan_start, "scanCacheCount")) {
1037
/* Read in restricted scan cache size */
1038
if(!scan_udata_helper(javaVM, scan_start, &extensions->fvtest_scanCacheCount, "scanCacheCount")) {
1039
goto _error;
1040
}
1041
goto _exit;
1042
}
1043
#endif /* J9VM_GC_MODRON_SCAVENGER || J9VM_GC_VLHGC */
1044
1045
if (try_scan(scan_start, "alwaysApplyOverflowRounding")) {
1046
/* see CMVC 12157 -- this option allows us to test overflow
1047
* rounding which is otherwise only applied if the heap is
1048
* allocated very high in the address space
1049
*/
1050
extensions->fvtest_alwaysApplyOverflowRounding = true;
1051
goto _exit;
1052
}
1053
1054
#if defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING)
1055
if (try_scan(scan_start, "forceFinalizeClassLoaders")) {
1056
/* CMVC 122432 - forces all class loaders to be cleaned up via a FinalizerFreeClassLoaderJob
1057
* during the finalization phase. Can be useful for testing that facility or to ensure that
1058
* there are no timing assumptions regarding class unloading in the rest of the VM
1059
*/
1060
extensions->fvtest_forceFinalizeClassLoaders = true;
1061
goto _exit;
1062
}
1063
#endif /* J9VM_GC_DYNAMIC_CLASS_UNLOADING */
1064
1065
/* Force an excessive GC to throw OOM after this many global GCs */
1066
if (try_scan(scan_start, "forceExcessiveAllocFailureAfter=")) {
1067
if(!scan_udata_helper(javaVM, scan_start, &(extensions->fvtest_forceExcessiveAllocFailureAfter), "forceExcessiveAllocFailureAfter=")) {
1068
goto _error;
1069
}
1070
goto _exit;
1071
}
1072
1073
/* VM Design 1869: force the heap to be allocated between these values */
1074
if (try_scan(scan_start, "verifyHeapAbove=")) {
1075
if(!scan_udata_memory_size_helper(javaVM, scan_start, (UDATA *)&(extensions->fvtest_verifyHeapAbove), "verifyHeapAbove=")) {
1076
goto _error;
1077
}
1078
goto _exit;
1079
}
1080
if (try_scan(scan_start, "verifyHeapBelow=")) {
1081
if(!scan_udata_memory_size_helper(javaVM, scan_start, (UDATA *)&(extensions->fvtest_verifyHeapBelow), "verifyHeapBelow=")) {
1082
goto _error;
1083
}
1084
goto _exit;
1085
}
1086
#if defined(J9VM_GC_VLHGC)
1087
if (try_scan(scan_start, "tarokVerifyMarkMapClosure")) {
1088
extensions->fvtest_tarokVerifyMarkMapClosure = true;
1089
goto _exit;
1090
}
1091
#endif /* defined(J9VM_GC_VLHGC) */
1092
1093
if( try_scan(scan_start, "disableInlineAllocation")) {
1094
extensions->fvtest_disableInlineAllocation = true;
1095
goto _exit;
1096
}
1097
1098
/* test option not recognised */
1099
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_FVTEST_UNKNOWN_TYPE, *scan_start);
1100
goto _error;
1101
}
1102
#if defined(J9VM_GC_VLHGC)
1103
#if defined(OMR_GC_VLHGC_CONCURRENT_COPY_FORWARD)
1104
if (try_scan(scan_start, "concurrentCopyForward")) {
1105
extensions->_isConcurrentCopyForward = true;
1106
goto _exit;
1107
}
1108
if (try_scan(scan_start, "noConcurrentCopyForward")) {
1109
extensions->_isConcurrentCopyForward = false;
1110
goto _exit;
1111
}
1112
#endif /* defined(OMR_GC_VLHGC_CONCURRENT_COPY_FORWARD) */
1113
#endif /* defined(J9VM_GC_VLHGC) */
1114
1115
#if defined(J9VM_GC_MODRON_SCAVENGER) || defined(J9VM_GC_VLHGC)
1116
/* If dynamicBreadthFirstScanOrdering is enabled, set scavengerScanOrdering and other required options */
1117
if(try_scan(scan_start, "dynamicBreadthFirstScanOrdering")) {
1118
extensions->scavengerScanOrdering = MM_GCExtensions::OMR_GC_SCAVENGER_SCANORDERING_DYNAMIC_BREADTH_FIRST;
1119
/* Below options are required options for dynamicBreadthFirstScanOrdering */
1120
extensions->scavengerAlignHotFields = false;
1121
goto _exit;
1122
}
1123
#endif /* defined(J9VM_GC_MODRON_SCAVENGER) || defined (J9VM_GC_VLHGC) */
1124
1125
#if defined(J9VM_GC_MODRON_SCAVENGER)
1126
if (try_scan(scan_start, "scanCacheSize=")) {
1127
/* Read in restricted scan cache size */
1128
if(!scan_udata_helper(javaVM, scan_start, &extensions->scavengerScanCacheMaximumSize, "scanCacheSize=")) {
1129
goto _error;
1130
}
1131
if(0 == extensions->scavengerScanCacheMaximumSize) {
1132
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "scanCacheSize=", (UDATA)0);
1133
goto _error;
1134
}
1135
goto _exit;
1136
}
1137
1138
if(try_scan(scan_start, "hierarchicalScanOrdering")) {
1139
extensions->scavengerScanOrdering = MM_GCExtensions::OMR_GC_SCAVENGER_SCANORDERING_HIERARCHICAL;
1140
goto _exit;
1141
}
1142
1143
if(try_scan(scan_start, "breadthFirstScanOrdering")) {
1144
extensions->scavengerScanOrdering = MM_GCExtensions::OMR_GC_SCAVENGER_SCANORDERING_BREADTH_FIRST;
1145
goto _exit;
1146
}
1147
#endif /* J9VM_GC_MODRON_SCAVENGER */
1148
1149
if(try_scan(scan_start, "alwaysCallWriteBarrier")) {
1150
extensions->alwaysCallWriteBarrier = true;
1151
goto _exit;
1152
}
1153
1154
if(try_scan(scan_start, "alwaysCallReadBarrier")) {
1155
extensions->alwaysCallReadBarrier = true;
1156
goto _exit;
1157
}
1158
1159
if(try_scan(scan_start, "sweepchunksize=")) {
1160
if(!scan_udata_helper(javaVM, scan_start, &extensions->parSweepChunkSize, "sweepchunksize=")) {
1161
goto _error;
1162
}
1163
if(0 == extensions->parSweepChunkSize) {
1164
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "sweepchunksize=", (UDATA)0);
1165
goto _error;
1166
}
1167
extensions->parSweepChunkSize *= 1024; /* the value is specified in kB on the command-line */
1168
1169
goto _exit;
1170
}
1171
1172
if(try_scan(scan_start, "verbosegcCycleTime=")) {
1173
if(!scan_udata_helper(javaVM, scan_start, &extensions->verbosegcCycleTime, "verbosegcCycleTime=")) {
1174
goto _error;
1175
}
1176
if(0 == extensions->verbosegcCycleTime) {
1177
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "verbosegcCycleTime=", (UDATA)0);
1178
goto _error;
1179
}
1180
1181
goto _exit;
1182
}
1183
1184
if (try_scan(scan_start, "verboseExtensions")) {
1185
extensions->verboseExtensions = true;
1186
goto _exit;
1187
}
1188
1189
if (try_scan(scan_start, "bufferedLogging")) {
1190
extensions->bufferedLogging = true;
1191
goto _exit;
1192
}
1193
1194
#if defined(J9VM_GC_VLHGC) || defined(J9VM_GC_GENERATIONAL)
1195
/* currently only used by VLHGC -- consider promoting if required for other policies */
1196
if (try_scan(scan_start, "numa")) {
1197
extensions->_numaManager.shouldEnablePhysicalNUMA(true);
1198
extensions->numaForced = true;
1199
goto _exit;
1200
}
1201
1202
if (try_scan(scan_start, "noNuma")) {
1203
extensions->_numaManager.shouldEnablePhysicalNUMA(false);
1204
extensions->numaForced = true;
1205
goto _exit;
1206
}
1207
#endif /* defined(J9VM_GC_VLHGC) || defined(J9VM_GC_GENERATIONAL) */
1208
1209
if (try_scan(scan_start, "hybridMemoryPool")) {
1210
extensions->enableHybridMemoryPool = true;
1211
goto _exit;
1212
}
1213
1214
/* Couldn't find a match for arguments */
1215
return 2;
1216
1217
_error:
1218
return 0;
1219
1220
_exit:
1221
return 1;
1222
}
1223
1224
/**
1225
* Parse the command line looking for -Xgc options.
1226
* @params optArg string to be parsed
1227
*/
1228
jint
1229
gcParseXgcArguments(J9JavaVM *vm, char *optArg)
1230
{
1231
char *scan_start = optArg;
1232
char *scan_limit = optArg + strlen(optArg);
1233
char *error_scan;
1234
MM_GCExtensions *extensions;
1235
PORT_ACCESS_FROM_JAVAVM(vm);
1236
1237
jint returnValue = JNI_OK;
1238
1239
extensions = MM_GCExtensions::getExtensions(vm);
1240
1241
while (scan_start < scan_limit) {
1242
UDATA scanResult;
1243
1244
/* ignore separators */
1245
try_scan(&scan_start, ",");
1246
1247
error_scan = scan_start;
1248
1249
/* TODO: inline when merged? */
1250
scanResult = j9gc_initialize_parse_gc_colon(vm, &scan_start);
1251
if (0 == scanResult) {
1252
returnValue = JNI_EINVAL;
1253
break;
1254
} else if (1 == scanResult) {
1255
continue;
1256
}
1257
/* if scanResult is 2, we will continue through */
1258
1259
#if defined(J9VM_GC_JNI_ARRAY_CACHE)
1260
if (try_scan(&scan_start, "jniArrayCacheMax=")) {
1261
if(try_scan(&scan_start, "unlimited")) {
1262
vm->jniArrayCacheMaxSize=((UDATA)-1);
1263
} else {
1264
if(!scan_udata_helper(vm, &scan_start, &vm->jniArrayCacheMaxSize, "jniArrayCacheMax=")) {
1265
returnValue = JNI_EINVAL;
1266
break;
1267
}
1268
}
1269
continue;
1270
}
1271
#endif /* J9VM_GC_JNI_ARRAY_CACHE */
1272
1273
#if defined(J9VM_GC_FINALIZATION)
1274
if (try_scan(&scan_start, "finInterval=")) {
1275
if (try_scan(&scan_start, "nodelay")) {
1276
extensions->finalizeCycleInterval = -1;
1277
} else {
1278
if(!scan_udata_helper(vm, &scan_start, (UDATA *)&extensions->finalizeCycleInterval, "finInterval=")) {
1279
returnValue = JNI_EINVAL;
1280
break;
1281
}
1282
}
1283
1284
if (extensions->finalizeCycleInterval == 0) {
1285
extensions->finalizeCycleInterval = -2;
1286
}
1287
continue;
1288
}
1289
if (try_scan(&scan_start, "finalizeMainPriority=")) {
1290
if(!scan_udata_helper(vm, &scan_start, &extensions->finalizeMainPriority, "finalizeMainPriority=")) {
1291
returnValue = JNI_EINVAL;
1292
break;
1293
}
1294
if((extensions->finalizeMainPriority < J9THREAD_PRIORITY_USER_MIN) || (extensions->finalizeMainPriority > J9THREAD_PRIORITY_USER_MAX)) {
1295
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "-Xgc:finalizeMainPriority", (UDATA)J9THREAD_PRIORITY_USER_MIN, (UDATA)J9THREAD_PRIORITY_USER_MAX);
1296
returnValue = JNI_EINVAL;
1297
break;
1298
}
1299
continue;
1300
}
1301
if (try_scan(&scan_start, "finalizeWorkerPriority=")) {
1302
if(!scan_udata_helper(vm, &scan_start, &extensions->finalizeWorkerPriority, "finalizeWorkerPriority=")) {
1303
returnValue = JNI_EINVAL;
1304
break;
1305
}
1306
if((extensions->finalizeWorkerPriority < J9THREAD_PRIORITY_USER_MIN) || (extensions->finalizeWorkerPriority > J9THREAD_PRIORITY_USER_MAX)) {
1307
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_INTEGER_OUT_OF_RANGE, "-Xgc:finalizeWorkerPriority", (UDATA)J9THREAD_PRIORITY_USER_MIN, (UDATA)J9THREAD_PRIORITY_USER_MAX);
1308
returnValue = JNI_EINVAL;
1309
break;
1310
}
1311
continue;
1312
}
1313
#endif /* J9VM_GC_FINALIZATION */
1314
1315
#if defined(J9MODRON_USE_CUSTOM_SPINLOCKS)
1316
if (try_scan(&scan_start, "spinCount1=")) {
1317
if(!scan_udata_helper(vm, &scan_start, &extensions->lnrlOptions.spinCount1, "spinCount1=")) {
1318
returnValue = JNI_EINVAL;
1319
break;
1320
}
1321
continue;
1322
}
1323
if (try_scan(&scan_start, "spinCount2=")) {
1324
if(!scan_udata_helper(vm, &scan_start, &extensions->lnrlOptions.spinCount2, "spinCount2=")) {
1325
returnValue = JNI_EINVAL;
1326
break;
1327
}
1328
continue;
1329
}
1330
if (try_scan(&scan_start, "spinCount3=")) {
1331
if(!scan_udata_helper(vm, &scan_start, &extensions->lnrlOptions.spinCount3, "spinCount3=")) {
1332
returnValue = JNI_EINVAL;
1333
break;
1334
}
1335
continue;
1336
}
1337
#endif /* J9MODRON_USE_CUSTOM_SPINLOCKS */
1338
1339
#if defined(J9VM_GC_DYNAMIC_CLASS_UNLOADING)
1340
if (try_scan(&scan_start, "deadClassLoaderCache=")) {
1341
if(!scan_udata_memory_size_helper(vm, &scan_start, &extensions->deadClassLoaderCacheSize, "deadClassLoaderCache=")) {
1342
returnValue = JNI_EINVAL;
1343
break;
1344
}
1345
continue;
1346
}
1347
1348
if (try_scan(&scan_start, "classUnloadingThreshold=")) {
1349
if ( !scan_udata_helper(vm, &scan_start, &extensions->dynamicClassUnloadingThreshold, "classUnloadingThreshold=")) {
1350
returnValue = JNI_EINVAL;
1351
break;
1352
}
1353
extensions->dynamicClassUnloadingThresholdForced = true;
1354
continue;
1355
}
1356
1357
if (try_scan(&scan_start,"classUnloadingKickoffThreshold=")) {
1358
if ( !scan_udata_helper(vm, &scan_start, &extensions->dynamicClassUnloadingKickoffThreshold, "classUnloadingKickoffThreshold=")) {
1359
returnValue = JNI_EINVAL;
1360
break;
1361
}
1362
extensions->dynamicClassUnloadingKickoffThresholdForced = true;
1363
continue;
1364
}
1365
1366
if (try_scan(&scan_start, "classUnloadingAnonymousClassWeight=")) {
1367
UDATA divisor = 0;
1368
if(!scan_udata_helper(vm, &scan_start, &divisor, "classUnloadingAnonymousClassWeight=")) {
1369
returnValue = JNI_EINVAL;
1370
break;
1371
}
1372
1373
if (0 == divisor) {
1374
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "classUnloadingAnonymousClassWeight=", (UDATA)0);
1375
returnValue = JNI_EINVAL;
1376
break;
1377
} else {
1378
extensions->classUnloadingAnonymousClassWeight = (1.0 / (double)divisor);
1379
}
1380
continue;
1381
}
1382
#endif /* J9VM_GC_DYNAMIC_CLASS_UNLOADING */
1383
1384
1385
if (try_scan(&scan_start, "allocationSamplingGranularity=")) {
1386
if ( !scan_udata_memory_size_helper(vm, &scan_start, &extensions->oolObjectSamplingBytesGranularity, "allocationSamplingGranularity=")) {
1387
returnValue = JNI_EINVAL;
1388
break;
1389
}
1390
extensions->doOutOfLineAllocationTrace = true;
1391
continue;
1392
}
1393
1394
if (try_scan(&scan_start, "allocationSamplingEnable")) {
1395
extensions->doOutOfLineAllocationTrace = true;
1396
continue;
1397
}
1398
1399
if (try_scan(&scan_start, "allocationSamplingDisable")) {
1400
extensions->doOutOfLineAllocationTrace = false;
1401
continue;
1402
}
1403
1404
/* see if we are forcing shifting to a specific value */
1405
if (try_scan(&scan_start, "preferredHeapBase=")) {
1406
UDATA preferredHeapBase = 0;
1407
if(!scan_hex_helper(vm, &scan_start, &preferredHeapBase, "preferredHeapBase=")) {
1408
returnValue = JNI_EINVAL;
1409
break;
1410
}
1411
1412
#if defined(J9ZOS390)
1413
j9nls_printf(PORTLIB, J9NLS_WARNING, J9NLS_GC_OPTIONS_PREFERREDHEAPBASE_NOT_SUPPORTED_ON_ZOS_WARN);
1414
#else
1415
extensions->preferredHeapBase = preferredHeapBase;
1416
#endif /* defined(J9ZOS390) */
1417
continue;
1418
}
1419
1420
/* see if they are requesting an initial suballocator heap size */
1421
if (try_scan(&scan_start, "suballocatorInitialSize=")) {
1422
if(!scan_udata_memory_size_helper(vm, &scan_start, &extensions->suballocatorInitialSize, "suballocatorInitialSize=")) {
1423
returnValue = JNI_EINVAL;
1424
break;
1425
}
1426
if(0 == extensions->suballocatorInitialSize) {
1427
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "-Xgc:suballocatorInitialSize=", (UDATA)0);
1428
returnValue = JNI_EINVAL;
1429
break;
1430
}
1431
continue;
1432
}
1433
1434
/* see if they are requesting a commit suballocator heap size */
1435
if (try_scan(&scan_start, "suballocatorCommitSize=")) {
1436
if(!scan_udata_memory_size_helper(vm, &scan_start, &extensions->suballocatorCommitSize, "suballocatorCommitSize=")) {
1437
returnValue = JNI_EINVAL;
1438
break;
1439
}
1440
if(0 == extensions->suballocatorCommitSize) {
1441
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTIONS_VALUE_MUST_BE_ABOVE, "-Xgc:suballocatorCommitSize=", (UDATA)0);
1442
returnValue = JNI_EINVAL;
1443
break;
1444
}
1445
continue;
1446
}
1447
1448
/* for testing and service reasons, split heaps is currently restricted to Win32 only */
1449
#if defined(J9VM_GC_GENERATIONAL) && (defined(WIN32) && !defined(WIN64))
1450
/* see if we are supposed to enable split heaps */
1451
if (try_scan(&scan_start, "splitheap")) {
1452
extensions->enableSplitHeap = true;
1453
/* If -Xgc:splitheap is specified, -Xgcpolicy:gencon is implicitly specified */
1454
extensions->configurationOptions._gcPolicy = gc_policy_gencon;
1455
continue;
1456
}
1457
#endif /* defined(J9VM_GC_GENERATIONAL) && (defined(WIN32) && !defined(WIN64)) */
1458
1459
/* Check for a user-specified region size for the fixed-sized table regions */
1460
if (try_scan(&scan_start, "regionSize=")) {
1461
if(!scan_udata_memory_size_helper(vm, &scan_start, &extensions->regionSize, "regionSize=")) {
1462
returnValue = JNI_EINVAL;
1463
break;
1464
}
1465
continue;
1466
}
1467
1468
#if defined(J9VM_GC_ENABLE_DOUBLE_MAP)
1469
if (try_scan(&scan_start, "enableArrayletDoubleMapping")) {
1470
extensions->isArrayletDoubleMapRequested = true;
1471
continue;
1472
}
1473
if (try_scan(&scan_start, "disableArrayletDoubleMapping")) {
1474
extensions->isArrayletDoubleMapRequested = false;
1475
continue;
1476
}
1477
#endif /* J9VM_GC_ENABLE_DOUBLE_MAP */
1478
1479
#if defined (J9VM_GC_VLHGC)
1480
if (try_scan(&scan_start, "fvtest_tarokForceNUMANode=")) {
1481
if(!scan_udata_helper(vm, &scan_start, &extensions->fvtest_tarokForceNUMANode, "fvtest_tarokForceNUMANode=")) {
1482
returnValue = JNI_EINVAL;
1483
break;
1484
}
1485
continue;
1486
}
1487
if (try_scan(&scan_start, "fvtest_tarokFirstContext=")) {
1488
if(!scan_udata_helper(vm, &scan_start, &extensions->fvtest_tarokFirstContext, "fvtest_tarokFirstContext=")) {
1489
returnValue = JNI_EINVAL;
1490
break;
1491
}
1492
continue;
1493
}
1494
#endif /* defined (J9VM_GC_VLHGC) */
1495
1496
if (try_scan(&scan_start, "verboseFormat=")) {
1497
if (try_scan(&scan_start, "default")) {
1498
extensions->verboseNewFormat = true;
1499
continue;
1500
}
1501
if (try_scan(&scan_start, "deprecated")) {
1502
extensions->verboseNewFormat = false;
1503
continue;
1504
}
1505
/* verbose format not recognised J9NLS_GC_OPTION_UNKNOWN*/
1506
/* j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_VERBOSEFORMAT_UNKNOWN_FORMAT, *scan_start); */
1507
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_UNKNOWN, error_scan);
1508
returnValue = JNI_EINVAL;
1509
break;
1510
}
1511
1512
/* Couldn't find a match for arguments */
1513
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_GC_OPTION_UNKNOWN, error_scan);
1514
returnValue = JNI_EINVAL;
1515
break;
1516
1517
}/* end loop */
1518
1519
return returnValue;
1520
}
1521
1522