author | stefank |
Tue, 26 Nov 2019 10:47:46 +0100 | |
changeset 59290 | 97d13893ec3c |
parent 58989 | f92ef5d182b5 |
child 59296 | 9186be5c78ba |
permissions | -rw-r--r-- |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
1 |
/* |
53370
687a5c204419
8217213: shenandoahTaskQueue.hpp includes .inline.hpp file
zgu
parents:
52925
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
4 |
* |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
8 |
* |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
13 |
* accompanied this code). |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
14 |
* |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
18 |
* |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
21 |
* questions. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
22 |
* |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
23 |
*/ |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
24 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
54678
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
26 |
#include "gc/shared/gcArguments.hpp" |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
27 |
#include "gc/shared/workerPolicy.hpp" |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
28 |
#include "gc/shenandoah/shenandoahArguments.hpp" |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
29 |
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp" |
53370
687a5c204419
8217213: shenandoahTaskQueue.hpp includes .inline.hpp file
zgu
parents:
52925
diff
changeset
|
30 |
#include "gc/shenandoah/shenandoahHeap.inline.hpp" |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
31 |
#include "gc/shenandoah/shenandoahHeapRegion.hpp" |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
32 |
#include "utilities/defaultStream.hpp" |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
33 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
34 |
void ShenandoahArguments::initialize() { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
35 |
#if !(defined AARCH64 || defined AMD64 || defined IA32) |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
36 |
vm_exit_during_initialization("Shenandoah GC is not supported on this platform."); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
37 |
#endif |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
38 |
|
55146 | 39 |
#if 0 // leave this block as stepping stone for future platforms |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
40 |
log_warning(gc)("Shenandoah GC is not fully supported on this platform:"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
41 |
log_warning(gc)(" concurrent modes are not supported, only STW cycles are enabled;"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
42 |
log_warning(gc)(" arch-specific barrier code is not implemented, disabling barriers;"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
43 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
44 |
FLAG_SET_DEFAULT(ShenandoahGCHeuristics, "passive"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
45 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
46 |
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false); |
54740
bdccc8c06ac7
8223448: Shenandoah disabled barriers blocks omit LRB
shade
parents:
54678
diff
changeset
|
47 |
FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier, false); |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
48 |
FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
49 |
FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
50 |
FLAG_SET_DEFAULT(ShenandoahCASBarrier, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
51 |
FLAG_SET_DEFAULT(ShenandoahCloneBarrier, false); |
54741
abffbe8557ab
8223450: Disable Shenandoah C2 barriers verification for x86_32
shade
parents:
54740
diff
changeset
|
52 |
|
abffbe8557ab
8223450: Disable Shenandoah C2 barriers verification for x86_32
shade
parents:
54740
diff
changeset
|
53 |
FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false); |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
54 |
#endif |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
55 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
56 |
if (UseLargePages && (MaxHeapSize / os::large_page_size()) < ShenandoahHeapRegion::MIN_NUM_REGIONS) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
57 |
warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit", |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
58 |
os::large_page_size() / K); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
59 |
FLAG_SET_DEFAULT(ShenandoahUncommit, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
60 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
61 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
62 |
// Enable NUMA by default. While Shenandoah is not NUMA-aware, enabling NUMA makes |
57977
42a13b4e9553
8230425: Shenandoah forces +UseNUMAInterleaving even after explicitly disabled
shade
parents:
55219
diff
changeset
|
63 |
// storage allocation code NUMA-aware. |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
64 |
if (FLAG_IS_DEFAULT(UseNUMA)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
65 |
FLAG_SET_DEFAULT(UseNUMA, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
66 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
67 |
|
55219
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
68 |
// Set up default number of concurrent threads. We want to have cycles complete fast |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
69 |
// enough, but we also do not want to steal too much CPU from the concurrently running |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
70 |
// application. Using 1/4 of available threads for concurrent GC seems a good |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
71 |
// compromise here. |
58482
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
72 |
bool ergo_conc = FLAG_IS_DEFAULT(ConcGCThreads); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
73 |
if (ergo_conc) { |
58989
f92ef5d182b5
8233850: Shenandoah: Shenandoah thread count ergonomics should be container aware
zgu
parents:
58482
diff
changeset
|
74 |
FLAG_SET_DEFAULT(ConcGCThreads, MAX2(1, os::initial_active_processor_count() / 4)); |
55219
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
75 |
} |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
76 |
|
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
77 |
if (ConcGCThreads == 0) { |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
78 |
vm_exit_during_initialization("Shenandoah expects ConcGCThreads > 0, check -XX:ConcGCThreads=#"); |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
79 |
} |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
80 |
|
55219
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
81 |
// Set up default number of parallel threads. We want to have decent pauses performance |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
82 |
// which would use parallel threads, but we also do not want to do too many threads |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
83 |
// that will overwhelm the OS scheduler. Using 1/2 of available threads seems to be a fair |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
84 |
// compromise here. Due to implementation constraints, it should not be lower than |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
85 |
// the number of concurrent threads. |
58482
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
86 |
bool ergo_parallel = FLAG_IS_DEFAULT(ParallelGCThreads); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
87 |
if (ergo_parallel) { |
58989
f92ef5d182b5
8233850: Shenandoah: Shenandoah thread count ergonomics should be container aware
zgu
parents:
58482
diff
changeset
|
88 |
FLAG_SET_DEFAULT(ParallelGCThreads, MAX2(1, os::initial_active_processor_count() / 2)); |
55219
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
89 |
} |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
90 |
|
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
91 |
if (ParallelGCThreads == 0) { |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
92 |
vm_exit_during_initialization("Shenandoah expects ParallelGCThreads > 0, check -XX:ParallelGCThreads=#"); |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
93 |
} |
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
94 |
|
58482
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
95 |
// Make sure ergonomic decisions do not break the thread count invariants. |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
96 |
// This may happen when user overrides one of the flags, but not the other. |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
97 |
// When that happens, we want to adjust the setting that was set ergonomically. |
55219
cfd1e298ca33
8225229: Shenandoah: trim down default number of GC threads
shade
parents:
55146
diff
changeset
|
98 |
if (ParallelGCThreads < ConcGCThreads) { |
58482
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
99 |
if (ergo_conc && !ergo_parallel) { |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
100 |
FLAG_SET_DEFAULT(ConcGCThreads, ParallelGCThreads); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
101 |
} else if (!ergo_conc && ergo_parallel) { |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
102 |
FLAG_SET_DEFAULT(ParallelGCThreads, ConcGCThreads); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
103 |
} else if (ergo_conc && ergo_parallel) { |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
104 |
// Should not happen, check the ergonomic computation above. Fail with relevant error. |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
105 |
vm_exit_during_initialization("Shenandoah thread count ergonomic error"); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
106 |
} else { |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
107 |
// User settings error, report and ask user to rectify. |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
108 |
vm_exit_during_initialization("Shenandoah expects ConcGCThreads <= ParallelGCThreads, check -XX:ParallelGCThreads, -XX:ConcGCThreads"); |
b4c660a75b54
8231932: Shenandoah: conc/par GC threads ergonomics overrides user settings
shade
parents:
57977
diff
changeset
|
109 |
} |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
110 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
111 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
112 |
if (FLAG_IS_DEFAULT(ParallelRefProcEnabled)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
113 |
FLAG_SET_DEFAULT(ParallelRefProcEnabled, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
114 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
115 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
116 |
if (ShenandoahRegionSampling && FLAG_IS_DEFAULT(PerfDataMemorySize)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
117 |
// When sampling is enabled, max out the PerfData memory to get more |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
118 |
// Shenandoah data in, including Matrix. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
119 |
FLAG_SET_DEFAULT(PerfDataMemorySize, 2048*K); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
120 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
121 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
122 |
#ifdef COMPILER2 |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
123 |
// Shenandoah cares more about pause times, rather than raw throughput. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
124 |
if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
125 |
FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
126 |
if (FLAG_IS_DEFAULT(LoopStripMiningIter)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
127 |
FLAG_SET_DEFAULT(LoopStripMiningIter, 1000); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
128 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
129 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
130 |
#ifdef ASSERT |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
131 |
// C2 barrier verification is only reliable when all default barriers are enabled |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
132 |
if (ShenandoahVerifyOptoBarriers && |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
133 |
(!FLAG_IS_DEFAULT(ShenandoahSATBBarrier) || |
54740
bdccc8c06ac7
8223448: Shenandoah disabled barriers blocks omit LRB
shade
parents:
54678
diff
changeset
|
134 |
!FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier) || |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
135 |
!FLAG_IS_DEFAULT(ShenandoahKeepAliveBarrier) || |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
136 |
!FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) || |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
137 |
!FLAG_IS_DEFAULT(ShenandoahCASBarrier) || |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
138 |
!FLAG_IS_DEFAULT(ShenandoahCloneBarrier) |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
139 |
)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
140 |
warning("Unusual barrier configuration, disabling C2 barrier verification"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
141 |
FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
142 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
143 |
#else |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
144 |
guarantee(!ShenandoahVerifyOptoBarriers, "Should be disabled"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
145 |
#endif // ASSERT |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
146 |
#endif // COMPILER2 |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
147 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
148 |
if (AlwaysPreTouch) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
149 |
// Shenandoah handles pre-touch on its own. It does not let the |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
150 |
// generic storage code to do the pre-touch before Shenandoah has |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
151 |
// a chance to do it on its own. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
152 |
FLAG_SET_DEFAULT(AlwaysPreTouch, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
153 |
FLAG_SET_DEFAULT(ShenandoahAlwaysPreTouch, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
154 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
155 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
156 |
// Record more information about previous cycles for improved debugging pleasure |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
157 |
if (FLAG_IS_DEFAULT(LogEventsBufferEntries)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
158 |
FLAG_SET_DEFAULT(LogEventsBufferEntries, 250); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
159 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
160 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
161 |
if (ShenandoahAlwaysPreTouch) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
162 |
if (!FLAG_IS_DEFAULT(ShenandoahUncommit)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
163 |
warning("AlwaysPreTouch is enabled, disabling ShenandoahUncommit"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
164 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
165 |
FLAG_SET_DEFAULT(ShenandoahUncommit, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
166 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
167 |
|
54478
cdc54443fee5
8222186: Shenandoah should not uncommit below minimum heap size
shade
parents:
54423
diff
changeset
|
168 |
if ((InitialHeapSize == MaxHeapSize) && ShenandoahUncommit) { |
cdc54443fee5
8222186: Shenandoah should not uncommit below minimum heap size
shade
parents:
54423
diff
changeset
|
169 |
log_info(gc)("Min heap equals to max heap, disabling ShenandoahUncommit"); |
cdc54443fee5
8222186: Shenandoah should not uncommit below minimum heap size
shade
parents:
54423
diff
changeset
|
170 |
FLAG_SET_DEFAULT(ShenandoahUncommit, false); |
cdc54443fee5
8222186: Shenandoah should not uncommit below minimum heap size
shade
parents:
54423
diff
changeset
|
171 |
} |
cdc54443fee5
8222186: Shenandoah should not uncommit below minimum heap size
shade
parents:
54423
diff
changeset
|
172 |
|
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
173 |
// If class unloading is disabled, no unloading for concurrent cycles as well. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
174 |
// If class unloading is enabled, users should opt-in for unloading during |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
175 |
// concurrent cycles. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
176 |
if (!ClassUnloading || !FLAG_IS_CMDLINE(ClassUnloadingWithConcurrentMark)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
177 |
log_info(gc)("Consider -XX:+ClassUnloadingWithConcurrentMark if large pause times " |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
178 |
"are observed on class-unloading sensitive workloads"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
179 |
FLAG_SET_DEFAULT(ClassUnloadingWithConcurrentMark, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
180 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
181 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
182 |
// AOT is not supported yet |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
183 |
if (UseAOT) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
184 |
if (!FLAG_IS_DEFAULT(UseAOT)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
185 |
warning("Shenandoah does not support AOT at this moment, disabling UseAOT"); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
186 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
187 |
FLAG_SET_DEFAULT(UseAOT, false); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
188 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
189 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
190 |
// TLAB sizing policy makes resizing decisions before each GC cycle. It averages |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
191 |
// historical data, assigning more recent data the weight according to TLABAllocationWeight. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
192 |
// Current default is good for generational collectors that run frequent young GCs. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
193 |
// With Shenandoah, GC cycles are much less frequent, so we need we need sizing policy |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
194 |
// to converge faster over smaller number of resizing decisions. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
195 |
if (FLAG_IS_DEFAULT(TLABAllocationWeight)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
196 |
FLAG_SET_DEFAULT(TLABAllocationWeight, 90); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
197 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
198 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
199 |
// Shenandoah needs more C2 nodes to compile some methods with lots of barriers. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
200 |
// NodeLimitFudgeFactor needs to stay the same relative to MaxNodeLimit. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
201 |
#ifdef COMPILER2 |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
202 |
if (FLAG_IS_DEFAULT(MaxNodeLimit)) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
203 |
FLAG_SET_DEFAULT(MaxNodeLimit, MaxNodeLimit * 3); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
204 |
FLAG_SET_DEFAULT(NodeLimitFudgeFactor, NodeLimitFudgeFactor * 3); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
205 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
206 |
#endif |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
207 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
208 |
// Make sure safepoint deadlocks are failing predictably. This sets up VM to report |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
209 |
// fatal error after 10 seconds of wait for safepoint syncronization (not the VM |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
210 |
// operation itself). There is no good reason why Shenandoah would spend that |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
211 |
// much time synchronizing. |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
212 |
#ifdef ASSERT |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
213 |
FLAG_SET_DEFAULT(SafepointTimeout, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
214 |
FLAG_SET_DEFAULT(SafepointTimeoutDelay, 10000); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
215 |
FLAG_SET_DEFAULT(AbortVMOnSafepointTimeout, true); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
216 |
#endif |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
217 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
218 |
|
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
219 |
size_t ShenandoahArguments::conservative_max_heap_alignment() { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
220 |
size_t align = ShenandoahMaxRegionSize; |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
221 |
if (UseLargePages) { |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
222 |
align = MAX2(align, os::large_page_size()); |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
223 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
224 |
return align; |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
225 |
} |
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
226 |
|
54678
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
227 |
void ShenandoahArguments::initialize_alignments() { |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
228 |
// Need to setup sizes early to get correct alignments. |
54832
0eee5adb22d7
8223759: Shenandoah should allow arbitrarily low initial heap size
shade
parents:
54741
diff
changeset
|
229 |
ShenandoahHeapRegion::setup_sizes(MaxHeapSize); |
54678
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
230 |
|
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
231 |
// This is expected by our algorithm for ShenandoahHeap::heap_region_containing(). |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
232 |
size_t align = ShenandoahHeapRegion::region_size_bytes(); |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
233 |
if (UseLargePages) { |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
234 |
align = MAX2(align, os::large_page_size()); |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
235 |
} |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
236 |
SpaceAlignment = align; |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
237 |
HeapAlignment = align; |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
238 |
} |
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
239 |
|
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
240 |
CollectedHeap* ShenandoahArguments::create_heap() { |
54678
93f09ca4a7f8
8198505: Remove CollectorPolicy and its subclasses
stefank
parents:
54478
diff
changeset
|
241 |
return new ShenandoahHeap(new ShenandoahCollectorPolicy()); |
52925
9c18c9d839d3
8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents:
diff
changeset
|
242 |
} |