g1_globals.hpp revision 9367:2a4e838901e9
1228753Smm/*
2228753Smm * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3228753Smm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4228753Smm *
5228753Smm * This code is free software; you can redistribute it and/or modify it
6228753Smm * under the terms of the GNU General Public License version 2 only, as
7228753Smm * published by the Free Software Foundation.
8228753Smm *
9228753Smm * This code is distributed in the hope that it will be useful, but WITHOUT
10228753Smm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11228753Smm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12228753Smm * version 2 for more details (a copy is included in the LICENSE file that
13228753Smm * accompanied this code).
14228753Smm *
15228753Smm * You should have received a copy of the GNU General Public License version
16228753Smm * 2 along with this work; if not, write to the Free Software Foundation,
17228753Smm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18228753Smm *
19228753Smm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20228753Smm * or visit www.oracle.com if you need additional information or have any
21228753Smm * questions.
22228753Smm *
23228753Smm */
24228753Smm
25228753Smm#ifndef SHARE_VM_GC_G1_G1_GLOBALS_HPP
26228763Smm#define SHARE_VM_GC_G1_G1_GLOBALS_HPP
27228753Smm
28228753Smm#include "runtime/globals.hpp"
29228753Smm#include <float.h> // for DBL_MAX
30228753Smm//
31228753Smm// Defines all globals flags used by the garbage-first compiler.
32228753Smm//
33228753Smm
34228753Smm#define G1_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, range, constraint) \
35228753Smm                                                                            \
36228753Smm  product(uintx, G1ConfidencePercent, 50,                                   \
37228753Smm          "Confidence level for MMU/pause predictions")                     \
38228753Smm          range(0, 100)                                                     \
39232153Smm                                                                            \
40228753Smm  develop(intx, G1MarkingOverheadPercent, 0,                                \
41228753Smm          "Overhead of concurrent marking")                                 \
42228753Smm          range(0, 100)                                                     \
43228753Smm                                                                            \
44228753Smm  develop(intx, G1MarkingVerboseLevel, 0,                                   \
45228753Smm          "Level (0-4) of verboseness of the marking code")                 \
46232153Smm          range(0, 4)                                                       \
47228753Smm                                                                            \
48228753Smm  develop(bool, G1TraceMarkStackOverflow, false,                            \
49228753Smm          "If true, extra debugging code for CM restart for ovflw.")        \
50228753Smm                                                                            \
51232153Smm  diagnostic(bool, G1SummarizeConcMark, false,                              \
52228753Smm          "Summarize concurrent mark info")                                 \
53228753Smm                                                                            \
54232153Smm  diagnostic(bool, G1SummarizeRSetStats, false,                             \
55232153Smm          "Summarize remembered set processing info")                       \
56228753Smm                                                                            \
57228753Smm  diagnostic(intx, G1SummarizeRSetStatsPeriod, 0,                           \
58228753Smm          "The period (in number of GCs) at which we will generate "        \
59228753Smm          "update buffer processing info "                                  \
60228753Smm          "(0 means do not periodically generate this info); "              \
61228753Smm          "it also requires -XX:+G1SummarizeRSetStats")                     \
62228753Smm          range(0, max_intx)                                                \
63228753Smm                                                                            \
64228753Smm  diagnostic(bool, G1TraceConcRefinement, false,                            \
65232153Smm          "Trace G1 concurrent refinement")                                 \
66228753Smm                                                                            \
67228753Smm  experimental(bool, G1TraceStringSymbolTableScrubbing, false,              \
68228753Smm          "Trace information string and symbol table scrubbing.")           \
69228753Smm                                                                            \
70228753Smm  product(double, G1ConcMarkStepDurationMillis, 10.0,                       \
71228753Smm          "Target duration of individual concurrent marking steps "         \
72228753Smm          "in milliseconds.")                                               \
73228753Smm          range(1.0, DBL_MAX)                                               \
74228753Smm                                                                            \
75228753Smm  product(intx, G1RefProcDrainInterval, 10,                                 \
76228753Smm          "The number of discovered reference objects to process before "   \
77228753Smm          "draining concurrent marking work queues.")                       \
78228753Smm          range(1, max_intx)                                                \
79228753Smm                                                                            \
80228753Smm  experimental(bool, G1UseConcMarkReferenceProcessing, true,                \
81228753Smm          "If true, enable reference discovery during concurrent "          \
82228753Smm          "marking and reference processing at the end of remark.")         \
83228753Smm                                                                            \
84228753Smm  experimental(double, G1LastPLABAverageOccupancy, 50.0,                    \
85228753Smm               "The expected average occupancy of the last PLAB in "        \
86228753Smm               "percent.")                                                  \
87232153Smm               range(0.001, 100.0)                                          \
88228753Smm                                                                            \
89228753Smm  product(size_t, G1SATBBufferSize, 1*K,                                    \
90228753Smm          "Number of entries in an SATB log buffer.")                       \
91228753Smm          range(1, max_uintx)                                               \
92232153Smm                                                                            \
93228753Smm  develop(intx, G1SATBProcessCompletedThreshold, 20,                        \
94228753Smm          "Number of completed buffers that triggers log processing.")      \
95228753Smm          range(0, max_jint)                                                \
96228753Smm                                                                            \
97228753Smm  product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60,                \
98228753Smm          "Before enqueueing them, each mutator thread tries to do some "   \
99228753Smm          "filtering on the SATB buffers it generates. If post-filtering "  \
100          "the percentage of retained entries is over this threshold "      \
101          "the buffer will be enqueued for processing. A value of 0 "       \
102          "specifies that mutator threads should not do such filtering.")   \
103          range(0, 100)                                                     \
104                                                                            \
105  experimental(intx, G1ExpandByPercentOfAvailable, 20,                      \
106          "When expanding, % of uncommitted space to claim.")               \
107          range(0, 100)                                                     \
108                                                                            \
109  develop(bool, G1RSBarrierRegionFilter, true,                              \
110          "If true, generate region filtering code in RS barrier")          \
111                                                                            \
112  diagnostic(bool, G1PrintRegionLivenessInfo, false,                        \
113            "Prints the liveness information for all regions in the heap "  \
114            "at the end of a marking cycle.")                               \
115                                                                            \
116  product(size_t, G1UpdateBufferSize, 256,                                  \
117          "Size of an update buffer")                                       \
118          range(1, NOT_LP64(32*M) LP64_ONLY(1*G))                           \
119                                                                            \
120  product(intx, G1ConcRefinementYellowZone, 0,                              \
121          "Number of enqueued update buffers that will "                    \
122          "trigger concurrent processing. Will be selected ergonomically "  \
123          "by default.")                                                    \
124          range(0, max_intx)                                                \
125                                                                            \
126  product(intx, G1ConcRefinementRedZone, 0,                                 \
127          "Maximum number of enqueued update buffers before mutator "       \
128          "threads start processing new ones instead of enqueueing them. "  \
129          "Will be selected ergonomically by default. Zero will disable "   \
130          "concurrent processing.")                                         \
131          range(0, max_intx)                                                \
132                                                                            \
133  product(intx, G1ConcRefinementGreenZone, 0,                               \
134          "The number of update buffers that are left in the queue by the " \
135          "concurrent processing threads. Will be selected ergonomically "  \
136          "by default.")                                                    \
137          range(0, max_intx)                                                \
138                                                                            \
139  product(intx, G1ConcRefinementServiceIntervalMillis, 300,                 \
140          "The last concurrent refinement thread wakes up every "           \
141          "specified number of milliseconds to do miscellaneous work.")     \
142          range(0, max_jint)                                                \
143                                                                            \
144  product(intx, G1ConcRefinementThresholdStep, 0,                           \
145          "Each time the rset update queue increases by this amount "       \
146          "activate the next refinement thread if available. "              \
147          "Will be selected ergonomically by default.")                     \
148                                                                            \
149  product(intx, G1RSetUpdatingPauseTimePercent, 10,                         \
150          "A target percentage of time that is allowed to be spend on "     \
151          "process RS update buffers during the collection pause.")         \
152          range(0, 100)                                                     \
153                                                                            \
154  product(bool, G1UseAdaptiveConcRefinement, true,                          \
155          "Select green, yellow and red zones adaptively to meet the "      \
156          "the pause requirements.")                                        \
157                                                                            \
158  product(size_t, G1ConcRSLogCacheSize, 10,                                 \
159          "Log base 2 of the length of conc RS hot-card cache.")            \
160          range(0, 27)                                                      \
161                                                                            \
162  product(uintx, G1ConcRSHotCardLimit, 4,                                   \
163          "The threshold that defines (>=) a hot card.")                    \
164          range(0, max_jubyte)                                              \
165                                                                            \
166  develop(intx, G1RSetRegionEntriesBase, 256,                               \
167          "Max number of regions in a fine-grain table per MB.")            \
168          range(1, max_jint/wordSize)                                       \
169                                                                            \
170  product(intx, G1RSetRegionEntries, 0,                                     \
171          "Max number of regions for which we keep bitmaps."                \
172          "Will be set ergonomically by default")                           \
173          range(0, max_jint/wordSize)                                       \
174          constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo)           \
175                                                                            \
176  develop(intx, G1RSetSparseRegionEntriesBase, 4,                           \
177          "Max number of entries per region in a sparse table "             \
178          "per MB.")                                                        \
179          range(1, max_jint/wordSize)                                       \
180                                                                            \
181  product(intx, G1RSetSparseRegionEntries, 0,                               \
182          "Max number of entries per region in a sparse table."             \
183          "Will be set ergonomically by default.")                          \
184          range(0, max_jint/wordSize)                                       \
185          constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo)     \
186                                                                            \
187  develop(intx, G1MaxVerifyFailures, -1,                                    \
188          "The maximum number of verification failures to print.  "         \
189          "-1 means print all.")                                            \
190          range(-1, max_jint)                                               \
191                                                                            \
192  develop(bool, G1ScrubRemSets, true,                                       \
193          "When true, do RS scrubbing after cleanup.")                      \
194                                                                            \
195  develop(bool, G1RSScrubVerbose, false,                                    \
196          "When true, do RS scrubbing with verbose output.")                \
197                                                                            \
198  develop(bool, G1YoungSurvRateVerbose, false,                              \
199          "print out the survival rate of young regions according to age.") \
200                                                                            \
201  develop(intx, G1YoungSurvRateNumRegionsSummary, 0,                        \
202          "the number of regions for which we'll print a surv rate "        \
203          "summary.")                                                       \
204          range(0, max_intx)                                                \
205          constraint(G1YoungSurvRateNumRegionsSummaryConstraintFunc,AfterErgo)\
206                                                                            \
207  product(uintx, G1ReservePercent, 10,                                      \
208          "It determines the minimum reserve we should have in the heap "   \
209          "to minimize the probability of promotion failure.")              \
210          range(0, 50)                                                      \
211                                                                            \
212  diagnostic(bool, G1PrintHeapRegions, false,                               \
213          "If set G1 will print information on which regions are being "    \
214          "allocated and which are reclaimed.")                             \
215                                                                            \
216  develop(bool, G1HRRSUseSparseTable, true,                                 \
217          "When true, use sparse table to save space.")                     \
218                                                                            \
219  develop(bool, G1HRRSFlushLogBuffersOnVerify, false,                       \
220          "Forces flushing of log buffers before verification.")            \
221                                                                            \
222  product(size_t, G1HeapRegionSize, 0,                                      \
223          "Size of the G1 regions.")                                        \
224          range(0, 32*M)                                                    \
225          constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit)        \
226                                                                            \
227  product(uintx, G1ConcRefinementThreads, 0,                                \
228          "If non-0 is the number of parallel rem set update threads, "     \
229          "otherwise the value is determined ergonomically.")               \
230          range(0, (max_jint-1)/wordSize)                                   \
231                                                                            \
232  develop(bool, G1VerifyCTCleanup, false,                                   \
233          "Verify card table cleanup.")                                     \
234                                                                            \
235  product(size_t, G1RSetScanBlockSize, 64,                                  \
236          "Size of a work unit of cards claimed by a worker thread"         \
237          "during RSet scanning.")                                          \
238          range(1, max_uintx)                                               \
239                                                                            \
240  develop(uintx, G1SecondaryFreeListAppendLength, 5,                        \
241          "The number of regions we will add to the secondary free list "   \
242          "at every append operation")                                      \
243                                                                            \
244  develop(bool, G1ConcRegionFreeingVerbose, false,                          \
245          "Enables verboseness during concurrent region freeing")           \
246                                                                            \
247  develop(bool, G1StressConcRegionFreeing, false,                           \
248          "It stresses the concurrent region freeing operation")            \
249                                                                            \
250  develop(uintx, G1StressConcRegionFreeingDelayMillis, 0,                   \
251          "Artificial delay during concurrent region freeing")              \
252                                                                            \
253  develop(uintx, G1DummyRegionsPerGC, 0,                                    \
254          "The number of dummy regions G1 will allocate at the end of "     \
255          "each evacuation pause in order to artificially fill up the "     \
256          "heap and stress the marking implementation.")                    \
257                                                                            \
258  develop(bool, G1ExitOnExpansionFailure, false,                            \
259          "Raise a fatal VM exit out of memory failure in the event "       \
260          " that heap expansion fails due to running out of swap.")         \
261                                                                            \
262  develop(uintx, G1ConcMarkForceOverflow, 0,                                \
263          "The number of times we'll force an overflow during "             \
264          "concurrent marking")                                             \
265                                                                            \
266  experimental(uintx, G1MaxNewSizePercent, 60,                              \
267          "Percentage (0-100) of the heap size to use as default "          \
268          " maximum young gen size.")                                       \
269          range(0, 100)                                                     \
270          constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
271                                                                            \
272  experimental(uintx, G1NewSizePercent, 5,                                  \
273          "Percentage (0-100) of the heap size to use as default "          \
274          "minimum young gen size.")                                        \
275          range(0, 100)                                                     \
276          constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
277                                                                            \
278  experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
279          "Threshold for regions to be considered for inclusion in the "    \
280          "collection set of mixed GCs. "                                   \
281          "Regions with live bytes exceeding this will not be collected.")  \
282          range(0, 100)                                                     \
283                                                                            \
284  product(uintx, G1HeapWastePercent, 5,                                     \
285          "Amount of space, expressed as a percentage of the heap size, "   \
286          "that G1 is willing not to collect to avoid expensive GCs.")      \
287          range(0, 100)                                                     \
288                                                                            \
289  product(uintx, G1MixedGCCountTarget, 8,                                   \
290          "The target number of mixed GCs after a marking cycle.")          \
291                                                                            \
292  experimental(bool, G1EagerReclaimHumongousObjects, true,                  \
293          "Try to reclaim dead large objects at every young GC.")           \
294                                                                            \
295  experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true,     \
296          "Try to reclaim dead large objects that have a few stale "        \
297          "references at every young GC.")                                  \
298                                                                            \
299  experimental(bool, G1TraceEagerReclaimHumongousObjects, false,            \
300          "Print some information about large object liveness "             \
301          "at every young GC.")                                             \
302                                                                            \
303  experimental(uintx, G1OldCSetRegionThresholdPercent, 10,                  \
304          "An upper bound for the number of old CSet regions expressed "    \
305          "as a percentage of the heap size.")                              \
306          range(0, 100)                                                     \
307                                                                            \
308  experimental(ccstr, G1LogLevel, NULL,                                     \
309          "Log level for G1 logging: fine, finer, finest")                  \
310                                                                            \
311  notproduct(bool, G1EvacuationFailureALot, false,                          \
312          "Force use of evacuation failure handling during certain "        \
313          "evacuation pauses")                                              \
314                                                                            \
315  develop(uintx, G1EvacuationFailureALotCount, 1000,                        \
316          "Number of successful evacuations between evacuation failures "   \
317          "occurring at object copying")                                    \
318                                                                            \
319  develop(uintx, G1EvacuationFailureALotInterval, 5,                        \
320          "Total collections between forced triggering of evacuation "      \
321          "failures")                                                       \
322                                                                            \
323  develop(bool, G1EvacuationFailureALotDuringConcMark, true,                \
324          "Force use of evacuation failure handling during evacuation "     \
325          "pauses when marking is in progress")                             \
326                                                                            \
327  develop(bool, G1EvacuationFailureALotDuringInitialMark, true,             \
328          "Force use of evacuation failure handling during initial mark "   \
329          "evacuation pauses")                                              \
330                                                                            \
331  develop(bool, G1EvacuationFailureALotDuringYoungGC, true,                 \
332          "Force use of evacuation failure handling during young "          \
333          "evacuation pauses")                                              \
334                                                                            \
335  develop(bool, G1EvacuationFailureALotDuringMixedGC, true,                 \
336          "Force use of evacuation failure handling during mixed "          \
337          "evacuation pauses")                                              \
338                                                                            \
339  diagnostic(bool, G1VerifyRSetsDuringFullGC, false,                        \
340          "If true, perform verification of each heap region's "            \
341          "remembered set when verifying the heap during a full GC.")       \
342                                                                            \
343  diagnostic(bool, G1VerifyHeapRegionCodeRoots, false,                      \
344          "Verify the code root lists attached to each heap region.")       \
345                                                                            \
346  develop(bool, G1VerifyBitmaps, false,                                     \
347          "Verifies the consistency of the marking bitmaps")
348
349G1_FLAGS(DECLARE_DEVELOPER_FLAG, \
350         DECLARE_PD_DEVELOPER_FLAG, \
351         DECLARE_PRODUCT_FLAG, \
352         DECLARE_PD_PRODUCT_FLAG, \
353         DECLARE_DIAGNOSTIC_FLAG, \
354         DECLARE_EXPERIMENTAL_FLAG, \
355         DECLARE_NOTPRODUCT_FLAG, \
356         DECLARE_MANAGEABLE_FLAG, \
357         DECLARE_PRODUCT_RW_FLAG, \
358         IGNORE_RANGE, \
359         IGNORE_CONSTRAINT)
360
361#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP
362