g1_globals.hpp revision 9644:033f40102037
1264790Sbapt/*
2264790Sbapt * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3264790Sbapt * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4264790Sbapt *
5264790Sbapt * This code is free software; you can redistribute it and/or modify it
6264790Sbapt * under the terms of the GNU General Public License version 2 only, as
7264790Sbapt * published by the Free Software Foundation.
8264790Sbapt *
9264790Sbapt * This code is distributed in the hope that it will be useful, but WITHOUT
10264790Sbapt * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11264790Sbapt * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12264790Sbapt * version 2 for more details (a copy is included in the LICENSE file that
13264790Sbapt * accompanied this code).
14264790Sbapt *
15264790Sbapt * You should have received a copy of the GNU General Public License version
16264790Sbapt * 2 along with this work; if not, write to the Free Software Foundation,
17264790Sbapt * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18264790Sbapt *
19264790Sbapt * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20264790Sbapt * or visit www.oracle.com if you need additional information or have any
21264790Sbapt * questions.
22264790Sbapt *
23264790Sbapt */
24264790Sbapt
25264790Sbapt#ifndef SHARE_VM_GC_G1_G1_GLOBALS_HPP
26264790Sbapt#define SHARE_VM_GC_G1_G1_GLOBALS_HPP
27264790Sbapt
28264790Sbapt#include "runtime/globals.hpp"
29264790Sbapt#include <float.h> // for DBL_MAX
30264790Sbapt//
31264790Sbapt// Defines all globals flags used by the garbage-first compiler.
32264790Sbapt//
33264790Sbapt
34264790Sbapt#define G1_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, range, constraint) \
35264790Sbapt                                                                            \
36264790Sbapt  product(bool, G1UseAdaptiveIHOP, true,                                    \
37264790Sbapt          "Adaptively adjust the initiating heap occupancy from the "       \
38264790Sbapt          "initial value of InitiatingHeapOccupancyPercent. The policy "    \
39264790Sbapt          "attempts to start marking in time based on application "         \
40264790Sbapt          "behavior.")                                                      \
41264790Sbapt                                                                            \
42264790Sbapt  experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3,                  \
43264790Sbapt          "How many completed time periods from initial mark to first "     \
44264790Sbapt          "mixed gc are required to use the input values for prediction "   \
45264790Sbapt          "of the optimal occupancy to start marking.")                     \
46264790Sbapt          range(1, max_intx)                                                \
47264790Sbapt                                                                            \
48264790Sbapt  product(uintx, G1ConfidencePercent, 50,                                   \
49264790Sbapt          "Confidence level for MMU/pause predictions")                     \
50264790Sbapt          range(0, 100)                                                     \
51264790Sbapt                                                                            \
52264790Sbapt  develop(intx, G1MarkingOverheadPercent, 0,                                \
53264790Sbapt          "Overhead of concurrent marking")                                 \
54264790Sbapt          range(0, 100)                                                     \
55264790Sbapt                                                                            \
56264790Sbapt  develop(intx, G1MarkingVerboseLevel, 0,                                   \
57264790Sbapt          "Level (0-4) of verboseness of the marking code")                 \
58264790Sbapt          range(0, 4)                                                       \
59264790Sbapt                                                                            \
60264790Sbapt  develop(bool, G1TraceMarkStackOverflow, false,                            \
61264790Sbapt          "If true, extra debugging code for CM restart for ovflw.")        \
62264790Sbapt                                                                            \
63264790Sbapt  diagnostic(bool, G1SummarizeConcMark, false,                              \
64264790Sbapt          "Summarize concurrent mark info")                                 \
65264790Sbapt                                                                            \
66264790Sbapt  diagnostic(bool, G1SummarizeRSetStats, false,                             \
67264790Sbapt          "Summarize remembered set processing info")                       \
68264790Sbapt                                                                            \
69264790Sbapt  diagnostic(intx, G1SummarizeRSetStatsPeriod, 0,                           \
70264790Sbapt          "The period (in number of GCs) at which we will generate "        \
71264790Sbapt          "update buffer processing info "                                  \
72264790Sbapt          "(0 means do not periodically generate this info); "              \
73264790Sbapt          "it also requires -XX:+G1SummarizeRSetStats")                     \
74264790Sbapt          range(0, max_intx)                                                \
75264790Sbapt                                                                            \
76264790Sbapt  diagnostic(bool, G1TraceConcRefinement, false,                            \
77264790Sbapt          "Trace G1 concurrent refinement")                                 \
78264790Sbapt                                                                            \
79264790Sbapt  experimental(bool, G1TraceStringSymbolTableScrubbing, false,              \
80264790Sbapt          "Trace information string and symbol table scrubbing.")           \
81264790Sbapt                                                                            \
82264790Sbapt  product(double, G1ConcMarkStepDurationMillis, 10.0,                       \
83264790Sbapt          "Target duration of individual concurrent marking steps "         \
84264790Sbapt          "in milliseconds.")                                               \
85264790Sbapt          range(1.0, DBL_MAX)                                               \
86264790Sbapt                                                                            \
87264790Sbapt  product(intx, G1RefProcDrainInterval, 10,                                 \
88264790Sbapt          "The number of discovered reference objects to process before "   \
89264790Sbapt          "draining concurrent marking work queues.")                       \
90264790Sbapt          range(1, max_intx)                                                \
91264790Sbapt                                                                            \
92264790Sbapt  experimental(bool, G1UseConcMarkReferenceProcessing, true,                \
93264790Sbapt          "If true, enable reference discovery during concurrent "          \
94264790Sbapt          "marking and reference processing at the end of remark.")         \
95264790Sbapt                                                                            \
96264790Sbapt  experimental(double, G1LastPLABAverageOccupancy, 50.0,                    \
97264790Sbapt               "The expected average occupancy of the last PLAB in "        \
98264790Sbapt               "percent.")                                                  \
99264790Sbapt               range(0.001, 100.0)                                          \
100264790Sbapt                                                                            \
101264790Sbapt  product(size_t, G1SATBBufferSize, 1*K,                                    \
102264790Sbapt          "Number of entries in an SATB log buffer.")                       \
103264790Sbapt          range(1, max_uintx)                                               \
104264790Sbapt                                                                            \
105264790Sbapt  develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
106264790Sbapt          "Number of completed buffers that triggers log processing.")      \
107264790Sbapt          range(0, max_jint)                                                \
108264790Sbapt                                                                            \
109264790Sbapt  product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60,                \
110264790Sbapt          "Before enqueueing them, each mutator thread tries to do some "   \
111264790Sbapt          "filtering on the SATB buffers it generates. If post-filtering "  \
112264790Sbapt          "the percentage of retained entries is over this threshold "      \
113264790Sbapt          "the buffer will be enqueued for processing. A value of 0 "       \
114264790Sbapt          "specifies that mutator threads should not do such filtering.")   \
115264790Sbapt          range(0, 100)                                                     \
116264790Sbapt                                                                            \
117264790Sbapt  experimental(intx, G1ExpandByPercentOfAvailable, 20,                      \
118264790Sbapt          "When expanding, % of uncommitted space to claim.")               \
119264790Sbapt          range(0, 100)                                                     \
120264790Sbapt                                                                            \
121264790Sbapt  develop(bool, G1RSBarrierRegionFilter, true,                              \
122264790Sbapt          "If true, generate region filtering code in RS barrier")          \
123264790Sbapt                                                                            \
124264790Sbapt  diagnostic(bool, G1PrintRegionLivenessInfo, false,                        \
125264790Sbapt            "Prints the liveness information for all regions in the heap "  \
126264790Sbapt            "at the end of a marking cycle.")                               \
127264790Sbapt                                                                            \
128264790Sbapt  product(size_t, G1UpdateBufferSize, 256,                                  \
129264790Sbapt          "Size of an update buffer")                                       \
130264790Sbapt          range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
131264790Sbapt                                                                            \
132264790Sbapt  product(intx, G1ConcRefinementYellowZone, 0,                              \
133264790Sbapt          "Number of enqueued update buffers that will "                    \
134264790Sbapt          "trigger concurrent processing. Will be selected ergonomically "  \
135264790Sbapt          "by default.")                                                    \
136264790Sbapt          range(0, max_intx)                                                \
137264790Sbapt                                                                            \
138264790Sbapt  product(intx, G1ConcRefinementRedZone, 0,                                 \
139264790Sbapt          "Maximum number of enqueued update buffers before mutator "       \
140264790Sbapt          "threads start processing new ones instead of enqueueing them. "  \
141264790Sbapt          "Will be selected ergonomically by default. Zero will disable "   \
142264790Sbapt          "concurrent processing.")                                         \
143264790Sbapt          range(0, max_intx)                                                \
144264790Sbapt                                                                            \
145264790Sbapt  product(intx, G1ConcRefinementGreenZone, 0,                               \
146264790Sbapt          "The number of update buffers that are left in the queue by the " \
147264790Sbapt          "concurrent processing threads. Will be selected ergonomically "  \
148264790Sbapt          "by default.")                                                    \
149264790Sbapt          range(0, max_intx)                                                \
150264790Sbapt                                                                            \
151264790Sbapt  product(intx, G1ConcRefinementServiceIntervalMillis, 300,                 \
152264790Sbapt          "The last concurrent refinement thread wakes up every "           \
153264790Sbapt          "specified number of milliseconds to do miscellaneous work.")     \
154264790Sbapt          range(0, max_jint)                                                \
155264790Sbapt                                                                            \
156264790Sbapt  product(intx, G1ConcRefinementThresholdStep, 0,                           \
157264790Sbapt          "Each time the rset update queue increases by this amount "       \
158264790Sbapt          "activate the next refinement thread if available. "              \
159264790Sbapt          "Will be selected ergonomically by default.")                     \
160264790Sbapt                                                                            \
161264790Sbapt  product(intx, G1RSetUpdatingPauseTimePercent, 10,                         \
162264790Sbapt          "A target percentage of time that is allowed to be spend on "     \
163264790Sbapt          "process RS update buffers during the collection pause.")         \
164264790Sbapt          range(0, 100)                                                     \
165264790Sbapt                                                                            \
166264790Sbapt  product(bool, G1UseAdaptiveConcRefinement, true,                          \
167264790Sbapt          "Select green, yellow and red zones adaptively to meet the "      \
168264790Sbapt          "the pause requirements.")                                        \
169264790Sbapt                                                                            \
170264790Sbapt  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
171264790Sbapt          "Log base 2 of the length of conc RS hot-card cache.")            \
172264790Sbapt          range(0, 27)                                                      \
173264790Sbapt                                                                            \
174264790Sbapt  product(uintx, G1ConcRSHotCardLimit, 4,                                   \
175264790Sbapt          "The threshold that defines (>=) a hot card.")                    \
176264790Sbapt          range(0, max_jubyte)                                              \
177264790Sbapt                                                                            \
178264790Sbapt  develop(intx, G1RSetRegionEntriesBase, 256,                               \
179264790Sbapt          "Max number of regions in a fine-grain table per MB.")            \
180264790Sbapt          range(1, max_jint/wordSize)                                       \
181264790Sbapt                                                                            \
182264790Sbapt  product(intx, G1RSetRegionEntries, 0,                                     \
183264790Sbapt          "Max number of regions for which we keep bitmaps."                \
184264790Sbapt          "Will be set ergonomically by default")                           \
185264790Sbapt          range(0, max_jint/wordSize)                                       \
186264790Sbapt          constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo)           \
187264790Sbapt                                                                            \
188264790Sbapt  develop(intx, G1RSetSparseRegionEntriesBase, 4,                           \
189264790Sbapt          "Max number of entries per region in a sparse table "             \
190264790Sbapt          "per MB.")                                                        \
191264790Sbapt          range(1, max_jint/wordSize)                                       \
192264790Sbapt                                                                            \
193264790Sbapt  product(intx, G1RSetSparseRegionEntries, 0,                               \
194264790Sbapt          "Max number of entries per region in a sparse table."             \
195264790Sbapt          "Will be set ergonomically by default.")                          \
196264790Sbapt          range(0, max_jint/wordSize)                                       \
197264790Sbapt          constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo)     \
198264790Sbapt                                                                            \
199264790Sbapt  develop(intx, G1MaxVerifyFailures, -1,                                    \
200264790Sbapt          "The maximum number of verification failures to print.  "         \
201264790Sbapt          "-1 means print all.")                                            \
202264790Sbapt          range(-1, max_jint)                                               \
203264790Sbapt                                                                            \
204264790Sbapt  develop(bool, G1ScrubRemSets, true,                                       \
205264790Sbapt          "When true, do RS scrubbing after cleanup.")                      \
206264790Sbapt                                                                            \
207264790Sbapt  develop(bool, G1RSScrubVerbose, false,                                    \
208264790Sbapt          "When true, do RS scrubbing with verbose output.")                \
209264790Sbapt                                                                            \
210264790Sbapt  develop(bool, G1YoungSurvRateVerbose, false,                              \
211264790Sbapt          "print out the survival rate of young regions according to age.") \
212264790Sbapt                                                                            \
213264790Sbapt  develop(intx, G1YoungSurvRateNumRegionsSummary, 0,                        \
214264790Sbapt          "the number of regions for which we'll print a surv rate "        \
215264790Sbapt          "summary.")                                                       \
216264790Sbapt          range(0, max_intx)                                                \
217264790Sbapt          constraint(G1YoungSurvRateNumRegionsSummaryConstraintFunc,AfterErgo)\
218264790Sbapt                                                                            \
219264790Sbapt  product(uintx, G1ReservePercent, 10,                                      \
220264790Sbapt          "It determines the minimum reserve we should have in the heap "   \
221264790Sbapt          "to minimize the probability of promotion failure.")              \
222264790Sbapt          range(0, 50)                                                      \
223264790Sbapt                                                                            \
224264790Sbapt  diagnostic(bool, G1PrintHeapRegions, false,                               \
225264790Sbapt          "If set G1 will print information on which regions are being "    \
226264790Sbapt          "allocated and which are reclaimed.")                             \
227264790Sbapt                                                                            \
228264790Sbapt  develop(bool, G1HRRSUseSparseTable, true,                                 \
229264790Sbapt          "When true, use sparse table to save space.")                     \
230264790Sbapt                                                                            \
231264790Sbapt  develop(bool, G1HRRSFlushLogBuffersOnVerify, false,                       \
232264790Sbapt          "Forces flushing of log buffers before verification.")            \
233264790Sbapt                                                                            \
234264790Sbapt  product(size_t, G1HeapRegionSize, 0,                                      \
235264790Sbapt          "Size of the G1 regions.")                                        \
236264790Sbapt          range(0, 32*M)                                                    \
237264790Sbapt          constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit)        \
238264790Sbapt                                                                            \
239264790Sbapt  product(uintx, G1ConcRefinementThreads, 0,                                \
240264790Sbapt          "If non-0 is the number of parallel rem set update threads, "     \
241264790Sbapt          "otherwise the value is determined ergonomically.")               \
242264790Sbapt          range(0, (max_jint-1)/wordSize)                                   \
243264790Sbapt                                                                            \
244264790Sbapt  develop(bool, G1VerifyCTCleanup, false,                                   \
245264790Sbapt          "Verify card table cleanup.")                                     \
246264790Sbapt                                                                            \
247264790Sbapt  product(size_t, G1RSetScanBlockSize, 64,                                  \
248264790Sbapt          "Size of a work unit of cards claimed by a worker thread"         \
249264790Sbapt          "during RSet scanning.")                                          \
250264790Sbapt          range(1, max_uintx)                                               \
251264790Sbapt                                                                            \
252264790Sbapt  develop(uintx, G1SecondaryFreeListAppendLength, 5,                        \
253264790Sbapt          "The number of regions we will add to the secondary free list "   \
254264790Sbapt          "at every append operation")                                      \
255264790Sbapt                                                                            \
256264790Sbapt  develop(bool, G1ConcRegionFreeingVerbose, false,                          \
257264790Sbapt          "Enables verboseness during concurrent region freeing")           \
258264790Sbapt                                                                            \
259264790Sbapt  develop(bool, G1StressConcRegionFreeing, false,                           \
260264790Sbapt          "It stresses the concurrent region freeing operation")            \
261264790Sbapt                                                                            \
262264790Sbapt  develop(uintx, G1StressConcRegionFreeingDelayMillis, 0,                   \
263264790Sbapt          "Artificial delay during concurrent region freeing")              \
264264790Sbapt                                                                            \
265264790Sbapt  develop(uintx, G1DummyRegionsPerGC, 0,                                    \
266264790Sbapt          "The number of dummy regions G1 will allocate at the end of "     \
267264790Sbapt          "each evacuation pause in order to artificially fill up the "     \
268264790Sbapt          "heap and stress the marking implementation.")                    \
269264790Sbapt                                                                            \
270264790Sbapt  develop(bool, G1ExitOnExpansionFailure, false,                            \
271264790Sbapt          "Raise a fatal VM exit out of memory failure in the event "       \
272264790Sbapt          " that heap expansion fails due to running out of swap.")         \
273264790Sbapt                                                                            \
274264790Sbapt  develop(uintx, G1ConcMarkForceOverflow, 0,                                \
275264790Sbapt          "The number of times we'll force an overflow during "             \
276264790Sbapt          "concurrent marking")                                             \
277264790Sbapt                                                                            \
278264790Sbapt  experimental(uintx, G1MaxNewSizePercent, 60,                              \
279264790Sbapt          "Percentage (0-100) of the heap size to use as default "          \
280264790Sbapt          " maximum young gen size.")                                       \
281264790Sbapt          range(0, 100)                                                     \
282264790Sbapt          constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
283264790Sbapt                                                                            \
284264790Sbapt  experimental(uintx, G1NewSizePercent, 5,                                  \
285264790Sbapt          "Percentage (0-100) of the heap size to use as default "          \
286264790Sbapt          "minimum young gen size.")                                        \
287264790Sbapt          range(0, 100)                                                     \
288264790Sbapt          constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
289264790Sbapt                                                                            \
290264790Sbapt  experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
291264790Sbapt          "Threshold for regions to be considered for inclusion in the "    \
292264790Sbapt          "collection set of mixed GCs. "                                   \
293264790Sbapt          "Regions with live bytes exceeding this will not be collected.")  \
294264790Sbapt          range(0, 100)                                                     \
295264790Sbapt                                                                            \
296264790Sbapt  product(uintx, G1HeapWastePercent, 5,                                     \
297264790Sbapt          "Amount of space, expressed as a percentage of the heap size, "   \
298264790Sbapt          "that G1 is willing not to collect to avoid expensive GCs.")      \
299264790Sbapt          range(0, 100)                                                     \
300264790Sbapt                                                                            \
301264790Sbapt  product(uintx, G1MixedGCCountTarget, 8,                                   \
302264790Sbapt          "The target number of mixed GCs after a marking cycle.")          \
303264790Sbapt                                                                            \
304264790Sbapt  experimental(bool, G1EagerReclaimHumongousObjects, true,                  \
305264790Sbapt          "Try to reclaim dead large objects at every young GC.")           \
306264790Sbapt                                                                            \
307264790Sbapt  experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true,     \
308264790Sbapt          "Try to reclaim dead large objects that have a few stale "        \
309264790Sbapt          "references at every young GC.")                                  \
310264790Sbapt                                                                            \
311264790Sbapt  experimental(bool, G1TraceEagerReclaimHumongousObjects, false,            \
312264790Sbapt          "Print some information about large object liveness "             \
313264790Sbapt          "at every young GC.")                                             \
314264790Sbapt                                                                            \
315264790Sbapt  experimental(uintx, G1OldCSetRegionThresholdPercent, 10,                  \
316264790Sbapt          "An upper bound for the number of old CSet regions expressed "    \
317264790Sbapt          "as a percentage of the heap size.")                              \
318264790Sbapt          range(0, 100)                                                     \
319264790Sbapt                                                                            \
320264790Sbapt  experimental(ccstr, G1LogLevel, NULL,                                     \
321264790Sbapt          "Log level for G1 logging: fine, finer, finest")                  \
322264790Sbapt                                                                            \
323264790Sbapt  notproduct(bool, G1EvacuationFailureALot, false,                          \
324264790Sbapt          "Force use of evacuation failure handling during certain "        \
325264790Sbapt          "evacuation pauses")                                              \
326264790Sbapt                                                                            \
327264790Sbapt  develop(uintx, G1EvacuationFailureALotCount, 1000,                        \
328264790Sbapt          "Number of successful evacuations between evacuation failures "   \
329264790Sbapt          "occurring at object copying")                                    \
330264790Sbapt                                                                            \
331264790Sbapt  develop(uintx, G1EvacuationFailureALotInterval, 5,                        \
332264790Sbapt          "Total collections between forced triggering of evacuation "      \
333264790Sbapt          "failures")                                                       \
334264790Sbapt                                                                            \
335264790Sbapt  develop(bool, G1EvacuationFailureALotDuringConcMark, true,                \
336264790Sbapt          "Force use of evacuation failure handling during evacuation "     \
337264790Sbapt          "pauses when marking is in progress")                             \
338264790Sbapt                                                                            \
339264790Sbapt  develop(bool, G1EvacuationFailureALotDuringInitialMark, true,             \
340264790Sbapt          "Force use of evacuation failure handling during initial mark "   \
341264790Sbapt          "evacuation pauses")                                              \
342264790Sbapt                                                                            \
343264790Sbapt  develop(bool, G1EvacuationFailureALotDuringYoungGC, true,                 \
344264790Sbapt          "Force use of evacuation failure handling during young "          \
345264790Sbapt          "evacuation pauses")                                              \
346264790Sbapt                                                                            \
347264790Sbapt  develop(bool, G1EvacuationFailureALotDuringMixedGC, true,                 \
348264790Sbapt          "Force use of evacuation failure handling during mixed "          \
349264790Sbapt          "evacuation pauses")                                              \
350264790Sbapt                                                                            \
351264790Sbapt  diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
352264790Sbapt          "If true, perform verification of each heap region's "            \
353264790Sbapt          "remembered set when verifying the heap during a full GC.")       \
354264790Sbapt                                                                            \
355264790Sbapt  diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
356264790Sbapt          "Verify the code root lists attached to each heap region.")       \
357264790Sbapt                                                                            \
358264790Sbapt  develop(bool, G1VerifyBitmaps, false,                                     \
359264790Sbapt          "Verifies the consistency of the marking bitmaps")
360264790Sbapt
361264790SbaptG1_FLAGS(DECLARE_DEVELOPER_FLAG, \
362264790Sbapt         DECLARE_PD_DEVELOPER_FLAG, \
363264790Sbapt         DECLARE_PRODUCT_FLAG, \
364264790Sbapt         DECLARE_PD_PRODUCT_FLAG, \
365264790Sbapt         DECLARE_DIAGNOSTIC_FLAG, \
366264790Sbapt         DECLARE_EXPERIMENTAL_FLAG, \
367264790Sbapt         DECLARE_NOTPRODUCT_FLAG, \
368264790Sbapt         DECLARE_MANAGEABLE_FLAG, \
369264790Sbapt         DECLARE_PRODUCT_RW_FLAG, \
370264790Sbapt         IGNORE_RANGE, \
371264790Sbapt         IGNORE_CONSTRAINT)
372264790Sbapt
373264790Sbapt#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
374264790Sbapt