g1_globals.hpp revision 13235:da0ca6f7b762
1133211Sharti/*
2156066Sharti * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3133211Sharti * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4133211Sharti *
5133211Sharti * This code is free software; you can redistribute it and/or modify it
6133211Sharti * under the terms of the GNU General Public License version 2 only, as
7133211Sharti * published by the Free Software Foundation.
8133211Sharti *
9133211Sharti * This code is distributed in the hope that it will be useful, but WITHOUT
10133211Sharti * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11133211Sharti * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12133211Sharti * version 2 for more details (a copy is included in the LICENSE file that
13133211Sharti * accompanied this code).
14133211Sharti *
15133211Sharti * You should have received a copy of the GNU General Public License version
16133211Sharti * 2 along with this work; if not, write to the Free Software Foundation,
17133211Sharti * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18133211Sharti *
19133211Sharti * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20133211Sharti * or visit www.oracle.com if you need additional information or have any
21133211Sharti * questions.
22133211Sharti *
23133211Sharti */
24133211Sharti
25133211Sharti#ifndef SHARE_VM_GC_G1_G1_GLOBALS_HPP
26133211Sharti#define SHARE_VM_GC_G1_G1_GLOBALS_HPP
27133211Sharti
28133211Sharti#include "runtime/globals.hpp"
29156066Sharti#include <float.h> // for DBL_MAX
30133211Sharti//
31133211Sharti// Defines all globals flags used by the garbage-first compiler.
32133211Sharti//
33133211Sharti
34133211Sharti#define G1_FLAGS(develop, \
35133211Sharti                 develop_pd, \
36133211Sharti                 product, \
37133211Sharti                 product_pd, \
38133211Sharti                 diagnostic, \
39133211Sharti                 diagnostic_pd, \
40133211Sharti                 experimental, \
41133211Sharti                 notproduct, \
42133211Sharti                 manageable, \
43133211Sharti                 product_rw, \
44133211Sharti                 range, \
45133211Sharti                 constraint, \
46133211Sharti                 writeable) \
47133211Sharti                                                                            \
48133211Sharti  product(bool, G1UseAdaptiveIHOP, true,                                    \
49133211Sharti          "Adaptively adjust the initiating heap occupancy from the "       \
50133211Sharti          "initial value of InitiatingHeapOccupancyPercent. The policy "    \
51133211Sharti          "attempts to start marking in time based on application "         \
52133211Sharti          "behavior.")                                                      \
53133211Sharti                                                                            \
54133211Sharti  experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3,                  \
55133211Sharti          "How many completed time periods from initial mark to first "     \
56133211Sharti          "mixed gc are required to use the input values for prediction "   \
57133211Sharti          "of the optimal occupancy to start marking.")                     \
58133211Sharti          range(1, max_intx)                                                \
59133211Sharti                                                                            \
60133211Sharti  product(uintx, G1ConfidencePercent, 50,                                   \
61133211Sharti          "Confidence level for MMU/pause predictions")                     \
62133211Sharti          range(0, 100)                                                     \
63133211Sharti                                                                            \
64133211Sharti  develop(intx, G1MarkingOverheadPercent, 0,                                \
65133211Sharti          "Overhead of concurrent marking")                                 \
66133211Sharti          range(0, 100)                                                     \
67133211Sharti                                                                            \
68133211Sharti  diagnostic(intx, G1SummarizeRSetStatsPeriod, 0,                           \
69133211Sharti          "The period (in number of GCs) at which we will generate "        \
70133211Sharti          "update buffer processing info "                                  \
71156066Sharti          "(0 means do not periodically generate this info); "              \
72156066Sharti          "it also requires that logging is enabled on the trace"           \
73156066Sharti          "level for gc+remset")                                            \
74156066Sharti          range(0, max_intx)                                                \
75156066Sharti                                                                            \
76133211Sharti  product(double, G1ConcMarkStepDurationMillis, 10.0,                       \
77156066Sharti          "Target duration of individual concurrent marking steps "         \
78156066Sharti          "in milliseconds.")                                               \
79156066Sharti          range(1.0, DBL_MAX)                                               \
80156066Sharti                                                                            \
81156066Sharti  product(intx, G1RefProcDrainInterval, 10,                                 \
82156066Sharti          "The number of discovered reference objects to process before "   \
83156066Sharti          "draining concurrent marking work queues.")                       \
84156066Sharti          range(1, max_intx)                                                \
85156066Sharti                                                                            \
86156066Sharti  experimental(double, G1LastPLABAverageOccupancy, 50.0,                    \
87156066Sharti               "The expected average occupancy of the last PLAB in "        \
88156066Sharti               "percent.")                                                  \
89156066Sharti               range(0.001, 100.0)                                          \
90156066Sharti                                                                            \
91156066Sharti  product(size_t, G1SATBBufferSize, 1*K,                                    \
92156066Sharti          "Number of entries in an SATB log buffer.")                       \
93156066Sharti          range(1, max_uintx)                                               \
94156066Sharti                                                                            \
95156066Sharti  develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
96156066Sharti          "Number of completed buffers that triggers log processing.")      \
97          range(0, max_jint)                                                \
98                                                                            \
99  product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60,                \
100          "Before enqueueing them, each mutator thread tries to do some "   \
101          "filtering on the SATB buffers it generates. If post-filtering "  \
102          "the percentage of retained entries is over this threshold "      \
103          "the buffer will be enqueued for processing. A value of 0 "       \
104          "specifies that mutator threads should not do such filtering.")   \
105          range(0, 100)                                                     \
106                                                                            \
107  experimental(intx, G1ExpandByPercentOfAvailable, 20,                      \
108          "When expanding, % of uncommitted space to claim.")               \
109          range(0, 100)                                                     \
110                                                                            \
111  develop(bool, G1RSBarrierRegionFilter, true,                              \
112          "If true, generate region filtering code in RS barrier")          \
113                                                                            \
114  product(size_t, G1UpdateBufferSize, 256,                                  \
115          "Size of an update buffer")                                       \
116          range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
117                                                                            \
118  product(size_t, G1ConcRefinementYellowZone, 0,                            \
119          "Number of enqueued update buffers that will "                    \
120          "trigger concurrent processing. Will be selected ergonomically "  \
121          "by default.")                                                    \
122          range(0, max_intx)                                                \
123                                                                            \
124  product(size_t, G1ConcRefinementRedZone, 0,                               \
125          "Maximum number of enqueued update buffers before mutator "       \
126          "threads start processing new ones instead of enqueueing them. "  \
127          "Will be selected ergonomically by default.")                     \
128          range(0, max_intx)                                                \
129                                                                            \
130  product(size_t, G1ConcRefinementGreenZone, 0,                             \
131          "The number of update buffers that are left in the queue by the " \
132          "concurrent processing threads. Will be selected ergonomically "  \
133          "by default.")                                                    \
134          range(0, max_intx)                                                \
135                                                                            \
136  product(uintx, G1ConcRefinementServiceIntervalMillis, 300,                \
137          "The last concurrent refinement thread wakes up every "           \
138          "specified number of milliseconds to do miscellaneous work.")     \
139          range(0, max_jint)                                                \
140                                                                            \
141  product(size_t, G1ConcRefinementThresholdStep, 2,                         \
142          "Each time the rset update queue increases by this amount "       \
143          "activate the next refinement thread if available. "              \
144          "The actual step size will be selected ergonomically by "         \
145          "default, with this value used to determine a lower bound.")      \
146          range(1, SIZE_MAX)                                                \
147                                                                            \
148  product(intx, G1RSetUpdatingPauseTimePercent, 10,                         \
149          "A target percentage of time that is allowed to be spend on "     \
150          "process RS update buffers during the collection pause.")         \
151          range(0, 100)                                                     \
152                                                                            \
153  product(bool, G1UseAdaptiveConcRefinement, true,                          \
154          "Select green, yellow and red zones adaptively to meet the "      \
155          "the pause requirements.")                                        \
156                                                                            \
157  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
158          "Log base 2 of the length of conc RS hot-card cache.")            \
159          range(0, 27)                                                      \
160                                                                            \
161  product(uintx, G1ConcRSHotCardLimit, 4,                                   \
162          "The threshold that defines (>=) a hot card.")                    \
163          range(0, max_jubyte)                                              \
164                                                                            \
165  develop(intx, G1RSetRegionEntriesBase, 256,                               \
166          "Max number of regions in a fine-grain table per MB.")            \
167          range(1, max_jint/wordSize)                                       \
168                                                                            \
169  product(intx, G1RSetRegionEntries, 0,                                     \
170          "Max number of regions for which we keep bitmaps."                \
171          "Will be set ergonomically by default")                           \
172          range(0, max_jint/wordSize)                                       \
173          constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo)           \
174                                                                            \
175  develop(intx, G1RSetSparseRegionEntriesBase, 4,                           \
176          "Max number of entries per region in a sparse table "             \
177          "per MB.")                                                        \
178          range(1, max_jint/wordSize)                                       \
179                                                                            \
180  product(intx, G1RSetSparseRegionEntries, 0,                               \
181          "Max number of entries per region in a sparse table."             \
182          "Will be set ergonomically by default.")                          \
183          range(0, max_jint/wordSize)                                       \
184          constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo)     \
185                                                                            \
186  develop(intx, G1MaxVerifyFailures, -1,                                    \
187          "The maximum number of verification failures to print.  "         \
188          "-1 means print all.")                                            \
189          range(-1, max_jint)                                               \
190                                                                            \
191  develop(bool, G1ScrubRemSets, true,                                       \
192          "When true, do RS scrubbing after cleanup.")                      \
193                                                                            \
194  product(uintx, G1ReservePercent, 10,                                      \
195          "It determines the minimum reserve we should have in the heap "   \
196          "to minimize the probability of promotion failure.")              \
197          range(0, 50)                                                      \
198                                                                            \
199  develop(bool, G1HRRSUseSparseTable, true,                                 \
200          "When true, use sparse table to save space.")                     \
201                                                                            \
202  product(size_t, G1HeapRegionSize, 0,                                      \
203          "Size of the G1 regions.")                                        \
204          range(0, 32*M)                                                    \
205          constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit)        \
206                                                                            \
207  product(uint, G1ConcRefinementThreads, 0,                                 \
208          "The number of parallel rem set update threads. "                 \
209          "Will be set ergonomically by default.")                          \
210          range(0, (max_jint-1)/wordSize)                                   \
211                                                                            \
212  develop(bool, G1VerifyCTCleanup, false,                                   \
213          "Verify card table cleanup.")                                     \
214                                                                            \
215  product(size_t, G1RSetScanBlockSize, 64,                                  \
216          "Size of a work unit of cards claimed by a worker thread"         \
217          "during RSet scanning.")                                          \
218          range(1, max_uintx)                                               \
219                                                                            \
220  develop(uintx, G1SecondaryFreeListAppendLength, 5,                        \
221          "The number of regions we will add to the secondary free list "   \
222          "at every append operation")                                      \
223                                                                            \
224  develop(bool, G1StressConcRegionFreeing, false,                           \
225          "It stresses the concurrent region freeing operation")            \
226                                                                            \
227  develop(uintx, G1StressConcRegionFreeingDelayMillis, 0,                   \
228          "Artificial delay during concurrent region freeing")              \
229                                                                            \
230  develop(uintx, G1DummyRegionsPerGC, 0,                                    \
231          "The number of dummy regions G1 will allocate at the end of "     \
232          "each evacuation pause in order to artificially fill up the "     \
233          "heap and stress the marking implementation.")                    \
234                                                                            \
235  develop(bool, G1ExitOnExpansionFailure, false,                            \
236          "Raise a fatal VM exit out of memory failure in the event "       \
237          " that heap expansion fails due to running out of swap.")         \
238                                                                            \
239  experimental(uintx, G1MaxNewSizePercent, 60,                              \
240          "Percentage (0-100) of the heap size to use as default "          \
241          " maximum young gen size.")                                       \
242          range(0, 100)                                                     \
243          constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
244                                                                            \
245  experimental(uintx, G1NewSizePercent, 5,                                  \
246          "Percentage (0-100) of the heap size to use as default "          \
247          "minimum young gen size.")                                        \
248          range(0, 100)                                                     \
249          constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
250                                                                            \
251  experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
252          "Threshold for regions to be considered for inclusion in the "    \
253          "collection set of mixed GCs. "                                   \
254          "Regions with live bytes exceeding this will not be collected.")  \
255          range(0, 100)                                                     \
256                                                                            \
257  product(uintx, G1HeapWastePercent, 5,                                     \
258          "Amount of space, expressed as a percentage of the heap size, "   \
259          "that G1 is willing not to collect to avoid expensive GCs.")      \
260          range(0, 100)                                                     \
261                                                                            \
262  product(uintx, G1MixedGCCountTarget, 8,                                   \
263          "The target number of mixed GCs after a marking cycle.")          \
264          range(0, max_uintx)                                               \
265                                                                            \
266  experimental(bool, G1PretouchAuxiliaryMemory, false,                      \
267          "Pre-touch large auxiliary data structures used by the GC.")      \
268                                                                            \
269  experimental(bool, G1EagerReclaimHumongousObjects, true,                  \
270          "Try to reclaim dead large objects at every young GC.")           \
271                                                                            \
272  experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true,     \
273          "Try to reclaim dead large objects that have a few stale "        \
274          "references at every young GC.")                                  \
275                                                                            \
276  experimental(uintx, G1OldCSetRegionThresholdPercent, 10,                  \
277          "An upper bound for the number of old CSet regions expressed "    \
278          "as a percentage of the heap size.")                              \
279          range(0, 100)                                                     \
280                                                                            \
281  notproduct(bool, G1EvacuationFailureALot, false,                          \
282          "Force use of evacuation failure handling during certain "        \
283          "evacuation pauses")                                              \
284                                                                            \
285  develop(uintx, G1EvacuationFailureALotCount, 1000,                        \
286          "Number of successful evacuations between evacuation failures "   \
287          "occurring at object copying")                                    \
288                                                                            \
289  develop(uintx, G1EvacuationFailureALotInterval, 5,                        \
290          "Total collections between forced triggering of evacuation "      \
291          "failures")                                                       \
292                                                                            \
293  develop(bool, G1EvacuationFailureALotDuringConcMark, true,                \
294          "Force use of evacuation failure handling during evacuation "     \
295          "pauses when marking is in progress")                             \
296                                                                            \
297  develop(bool, G1EvacuationFailureALotDuringInitialMark, true,             \
298          "Force use of evacuation failure handling during initial mark "   \
299          "evacuation pauses")                                              \
300                                                                            \
301  develop(bool, G1EvacuationFailureALotDuringYoungGC, true,                 \
302          "Force use of evacuation failure handling during young "          \
303          "evacuation pauses")                                              \
304                                                                            \
305  develop(bool, G1EvacuationFailureALotDuringMixedGC, true,                 \
306          "Force use of evacuation failure handling during mixed "          \
307          "evacuation pauses")                                              \
308                                                                            \
309  diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
310          "If true, perform verification of each heap region's "            \
311          "remembered set when verifying the heap during a full GC.")       \
312                                                                            \
313  diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
314          "Verify the code root lists attached to each heap region.")       \
315                                                                            \
316  develop(bool, G1VerifyBitmaps, false,                                     \
317          "Verifies the consistency of the marking bitmaps")
318
319G1_FLAGS(DECLARE_DEVELOPER_FLAG, \
320         DECLARE_PD_DEVELOPER_FLAG, \
321         DECLARE_PRODUCT_FLAG, \
322         DECLARE_PD_PRODUCT_FLAG, \
323         DECLARE_DIAGNOSTIC_FLAG, \
324         DECLARE_PD_DIAGNOSTIC_FLAG, \
325         DECLARE_EXPERIMENTAL_FLAG, \
326         DECLARE_NOTPRODUCT_FLAG, \
327         DECLARE_MANAGEABLE_FLAG, \
328         DECLARE_PRODUCT_RW_FLAG, \
329         IGNORE_RANGE, \
330         IGNORE_CONSTRAINT, \
331         IGNORE_WRITEABLE)
332
333#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
334