1 /* 2 * Copyright (c) 2016, Red Hat, Inc. and/or its affiliates. 3 * 4 * This code is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 only, as 6 * published by the Free Software Foundation. 7 * 8 * This code is distributed in the hope that it will be useful, but WITHOUT 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 * version 2 for more details (a copy is included in the LICENSE file that 12 * accompanied this code). 13 * 14 * You should have received a copy of the GNU General Public License version 15 * 2 along with this work; if not, write to the Free Software Foundation, 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 * 18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 19 * or visit www.oracle.com if you need additional information or have any 20 * questions. 21 * 22 */ 23 24 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP 25 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP 26 27 #include "runtime/globals.hpp" 28 29 #define SHENANDOAH_FLAGS(develop, \ 30 develop_pd, \ 31 product, \ 32 product_pd, \ 33 diagnostic, \ 34 experimental, \ 35 notproduct, \ 36 manageable, \ 37 product_rw, \ 38 range, \ 39 constraint, \ 40 writeable) \ 41 \ 42 product(bool, UseShenandoahGC, false, \ 43 "Use the Shenandoah garbage collector") \ 44 \ 45 product(bool, ShenandoahOptimizeFinals, true, \ 46 "Optimize barriers on final and stable fields/arrays. " \ 47 "Turn it off for maximum compatibility with reflection or JNI " \ 48 "code that manipulates final fields." \ 49 "Defaults to true. ") \ 50 \ 51 product(uintx, ShenandoahHeapRegionSize, 0, \ 52 "Size of the Shenandoah regions. " \ 53 "Determined automatically by default.") \ 54 \ 55 product(ccstr, ShenandoahGCHeuristics, "dynamic", \ 56 "The heuristics to use in Shenandoah GC. Possible values: " \ 57 "dynamic, adaptive, aggressive." \ 58 "Defauls to dynamic") \ 59 \ 60 product(uintx, ShenandoahAllocReserveRegions, 10, \ 61 "How many regions should be kept as allocation reserve, before " \ 62 "Shenandoah attempts to grow the heap. Defaults to 10.") \ 63 \ 64 product(uintx, ShenandoahRefProcFrequency, 5, \ 65 "How often should (weak, soft, etc) references be processed. " \ 66 "References get processed at every Nth GC cycle. " \ 67 "Set to 0 to disable reference processing. " \ 68 "Defaults to process references every 5 cycles.") \ 69 \ 70 product(uintx, ShenandoahUnloadClassesFrequency, 5, \ 71 "How often should classes get unloaded. " \ 72 "Class unloading is performed at every Nth GC cycle. " \ 73 "Set to 0 to disable concurrent class unloading. " \ 74 "Defaults to unload classes every 5 cycles.") \ 75 \ 76 product_rw(uintx, ShenandoahGarbageThreshold, 60, \ 77 "Sets the percentage of garbage a region need to contain before " \ 78 "it can be marked for collection. Applies to " \ 79 "Shenandoah GC dynamic Heuristic mode only (ignored otherwise). " \ 80 "Defaults to 60%.") \ 81 range(0,100) \ 82 \ 83 product_rw(uintx, ShenandoahFreeThreshold, 25, \ 84 "Set the percentage of free heap at which a GC cycle is started. " \ 85 "Applies to Shenandoah GC dynamic Heuristic mode only " \ 86 "(ignored otherwise). Defaults to 25%.") \ 87 range(0,100) \ 88 \ 89 product_rw(uintx, ShenandoahInitialFreeThreshold, 50, \ 90 "Set the percentage of free heap at which an initial GC cycle " \ 91 "is started. An initial GC cycle is the first one after VM " \ 92 "start or after a full GC." \ 93 "Applies to Shenandoah GC dynamic Heuristic mode only " \ 94 "(ignored otherwise). Defaults to 50%.") \ 95 range(0,100) \ 96 \ 97 product_rw(uintx, ShenandoahAllocationThreshold, 0, \ 98 "Set percentage of memory allocated since last GC cycle before " \ 99 "a new GC cycle is started. " \ 100 "Applies to Shenandoah GC dynamic Heuristic mode only " \ 101 "(ignored otherwise). Defauls to 0%.") \ 102 range(0,100) \ 103 \ 104 experimental(uint, ShenandoahMarkLoopStride, 1000, \ 105 "How many items are processed during one marking step") \ 106 \ 107 experimental(bool, ShenandoahConcurrentCodeRoots, false, \ 108 "Scan code roots concurrently, instead of during a pause") \ 109 \ 110 experimental(bool, ShenandoahNoBarriersForConst, true, \ 111 "Constant oops don't need barriers") \ 112 \ 113 experimental(bool, ShenandoahDontIncreaseWBFreq, true, \ 114 "Common 2 WriteBarriers or WriteBarrier and a ReadBarrier only " \ 115 "if the resulting WriteBarrier isn't executed more frequently") \ 116 \ 117 experimental(bool, ShenandoahNoLivenessFullGC, true, \ 118 "Skip liveness counting for mark during full GC.") \ 119 \ 120 experimental(bool, ShenandoahWriteBarrierToIR, true, \ 121 "Convert write barrier to IR instead of using assembly blob") \ 122 \ 123 experimental(bool, UseShenandoahOWST, false, \ 124 "Use ShenandoahTaskTerminator") \ 125 \ 126 diagnostic(bool, ShenandoahWriteBarrier, true, \ 127 "Turn on/off write barriers in Shenandoah") \ 128 \ 129 diagnostic(bool, ShenandoahReadBarrier, true, \ 130 "Turn on/off read barriers in Shenandoah") \ 131 \ 132 diagnostic(bool, ShenandoahStoreCheck, false, \ 133 "Emit additional code that checks objects are written to only" \ 134 " in to-space") \ 135 \ 136 develop(bool, ShenandoahDumpHeapBeforeConcurrentMark, false, \ 137 "Dump the ShenanodahHeap Before Each ConcurrentMark") \ 138 \ 139 develop(bool, ShenandoahDumpHeapAfterConcurrentMark, false, \ 140 "Dump the ShenanodahHeap After Each Concurrent Mark") \ 141 \ 142 develop(bool, ShenandoahVerifyWritesToFromSpace, false, \ 143 "Use Memory Protection to signal illegal writes to from space") \ 144 \ 145 develop(bool, ShenandoahVerifyReadsToFromSpace, false, \ 146 "Use Memory Protection to signal illegal reads to from space") \ 147 \ 148 develop(bool, ShenandoahVerify, false, \ 149 "Verify the Shenandoah garbage collector") \ 150 \ 151 develop(bool, VerifyStrictOopOperations, false, \ 152 "Verify that == and != are not used on oops. Only in fastdebug") \ 153 \ 154 develop(bool, ShenandoahVerifyOptoBarriers, false, \ 155 "Verify no missing barriers in c2") \ 156 \ 157 product(bool, ShenandoahAlwaysPreTouch, false, \ 158 "Pre-touch heap memory, overrides global AlwaysPreTouch") \ 159 \ 160 experimental(intx, ShenandoahMarkScanPrefetch, 32, \ 161 "How many objects to prefetch ahead when traversing mark bitmaps." \ 162 "Set to 0 to disable prefetching.") \ 163 range(0, 1024) \ 164 165 166 SHENANDOAH_FLAGS(DECLARE_DEVELOPER_FLAG, \ 167 DECLARE_PD_DEVELOPER_FLAG, \ 168 DECLARE_PRODUCT_FLAG, \ 169 DECLARE_PD_PRODUCT_FLAG, \ 170 DECLARE_DIAGNOSTIC_FLAG, \ 171 DECLARE_EXPERIMENTAL_FLAG, \ 172 DECLARE_NOTPRODUCT_FLAG, \ 173 DECLARE_MANAGEABLE_FLAG, \ 174 DECLARE_PRODUCT_RW_FLAG, \ 175 IGNORE_RANGE, \ 176 IGNORE_CONSTRAINT, \ 177 IGNORE_WRITEABLE) 178 179 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAH_GLOBALS_HPP