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