author | tschatzl |
Wed, 08 Aug 2018 15:31:06 +0200 | |
changeset 51332 | c25572739e7c |
parent 50523 | 7b7c75d87f9b |
child 51645 | c5f700de5450 |
permissions | -rw-r--r-- |
50523
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
1 |
/* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
4 |
* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
8 |
* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
13 |
* accompanied this code). |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
14 |
* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
18 |
* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
21 |
* questions. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
22 |
* |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
23 |
*/ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
24 |
|
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_GC_EPSILON_GLOBALS_HPP |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
26 |
#define SHARE_VM_GC_EPSILON_GLOBALS_HPP |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
27 |
|
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
28 |
#include "runtime/globals.hpp" |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
29 |
// |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
30 |
// Defines all globals flags used by the Epsilon GC. |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
31 |
// |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
32 |
|
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
33 |
#define GC_EPSILON_FLAGS(develop, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
34 |
develop_pd, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
35 |
product, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
36 |
product_pd, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
37 |
diagnostic, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
38 |
diagnostic_pd, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
39 |
experimental, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
40 |
notproduct, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
41 |
manageable, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
42 |
product_rw, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
43 |
lp64_product, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
44 |
range, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
45 |
constraint, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
46 |
writeable) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
47 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
48 |
experimental(size_t, EpsilonPrintHeapSteps, 20, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
49 |
"Print heap occupancy stats with this number of steps. " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
50 |
"0 turns the printing off.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
51 |
range(0, max_intx) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
52 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
53 |
experimental(size_t, EpsilonUpdateCountersStep, 1 * M, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
54 |
"Update heap occupancy counters after allocating this much " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
55 |
"memory. Higher values would make allocations faster at " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
56 |
"the expense of lower resolution in heap counters.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
57 |
range(1, max_intx) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
58 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
59 |
experimental(size_t, EpsilonMaxTLABSize, 4 * M, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
60 |
"Max TLAB size to use with Epsilon GC. Larger value improves " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
61 |
"performance at the expense of per-thread memory waste. This " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
62 |
"asks TLAB machinery to cap TLAB sizes at this value.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
63 |
range(1, max_intx) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
64 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
65 |
experimental(bool, EpsilonElasticTLAB, true, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
66 |
"Use elastic policy to manage TLAB sizes. This conserves memory " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
67 |
"for non-actively allocating threads, even when they request " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
68 |
"large TLABs for themselves. Active threads would experience " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
69 |
"smaller TLABs until policy catches up.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
70 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
71 |
experimental(bool, EpsilonElasticTLABDecay, true, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
72 |
"Use timed decays to shrik TLAB sizes. This conserves memory " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
73 |
"for the threads that allocate in bursts of different sizes, " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
74 |
"for example the small/rare allocations coming after the initial "\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
75 |
"large burst.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
76 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
77 |
experimental(double, EpsilonTLABElasticity, 1.1, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
78 |
"Multiplier to use when deciding on next TLAB size. Larger value "\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
79 |
"improves performance at the expense of per-thread memory waste. "\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
80 |
"Lower value improves memory footprint, but penalizes actively " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
81 |
"allocating threads.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
82 |
range(1, max_intx) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
83 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
84 |
experimental(size_t, EpsilonTLABDecayTime, 1000, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
85 |
"TLAB sizing policy decays to initial size after thread had not " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
86 |
"allocated for this long. Time is in milliseconds. Lower value " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
87 |
"improves memory footprint, but penalizes actively allocating " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
88 |
"threads.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
89 |
range(1, max_intx) \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
90 |
\ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
91 |
experimental(size_t, EpsilonMinHeapExpand, 128 * M, \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
92 |
"Min expansion step for heap. Larger value improves performance " \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
93 |
"at the potential expense of memory waste.") \ |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
94 |
range(1, max_intx) |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
95 |
|
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
diff
changeset
|
96 |
#endif // SHARE_VM_GC_EPSILON_GLOBALS_HPP |