/* * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #ifndef SHARE_GC_SHARED_GC_GLOBALS_HPP #define SHARE_GC_SHARED_GC_GLOBALS_HPP #include "runtime/globals_shared.hpp" #include "utilities/macros.hpp" #if INCLUDE_EPSILONGC #include "gc/epsilon/epsilon_globals.hpp" #endif #if INCLUDE_G1GC #include "gc/g1/g1_globals.hpp" #endif #if INCLUDE_PARALLELGC #include "gc/parallel/parallel_globals.hpp" #endif #if INCLUDE_SERIALGC #include "gc/serial/serial_globals.hpp" #endif #if INCLUDE_SHENANDOAHGC #include "gc/shenandoah/shenandoah_globals.hpp" #endif #if INCLUDE_ZGC #include "gc/z/z_globals.hpp" #endif #include "runtime/flags/jvmFlag.hpp" PRODUCT_FLAG(bool, UseSerialGC, false, JVMFlag::DEFAULT, "Use the Serial garbage collector"); PRODUCT_FLAG(bool, UseG1GC, false, JVMFlag::DEFAULT, "Use the Garbage-First garbage collector"); PRODUCT_FLAG(bool, UseParallelGC, false, JVMFlag::DEFAULT, "Use the Parallel garbage collector."); PRODUCT_FLAG(bool, UseEpsilonGC, false, JVMFlag::EXPERIMENTAL, "Use the Epsilon (no-op) garbage collector"); PRODUCT_FLAG(bool, UseZGC, false, JVMFlag::DEFAULT, "Use the Z garbage collector"); PRODUCT_FLAG(bool, UseShenandoahGC, false, JVMFlag::EXPERIMENTAL, "Use the Shenandoah garbage collector"); PRODUCT_FLAG(uint, ParallelGCThreads, 0, JVMFlag::CONSTRAINT, "Number of parallel threads parallel gc will use"); FLAG_CONSTRAINT( ParallelGCThreads, (void*)ParallelGCThreadsConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(bool, UseSemaphoreGCThreadsSynchronization, true, JVMFlag::DIAGNOSTIC, "Use semaphore synchronization for the GC Threads, " "instead of synchronization based on mutexes"); PRODUCT_FLAG(bool, UseDynamicNumberOfGCThreads, true, JVMFlag::DEFAULT, "Dynamically choose the number of threads up to a maximum of " "ParallelGCThreads parallel collectors will use for garbage " "collection work"); PRODUCT_FLAG(bool, InjectGCWorkerCreationFailure, false, JVMFlag::DIAGNOSTIC, "Inject thread creation failures for " "UseDynamicNumberOfGCThreads"); PRODUCT_FLAG(size_t, HeapSizePerGCThread, ScaleForWordSize(32*M), JVMFlag::RANGE, "Size of heap (bytes) per GC thread used in calculating the " "number of GC threads"); FLAG_CUSTOM_RANGE( HeapSizePerGCThread, VMPageSize); PRODUCT_FLAG(uint, ConcGCThreads, 0, JVMFlag::CONSTRAINT, "Number of threads concurrent gc will use"); FLAG_CONSTRAINT( ConcGCThreads, (void*)ConcGCThreadsConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(bool, AlwaysTenure, false, JVMFlag::DEFAULT, "Always tenure objects in eden (ParallelGC only)"); PRODUCT_FLAG(bool, NeverTenure, false, JVMFlag::DEFAULT, "Never tenure objects in eden, may tenure on overflow " "(ParallelGC only)"); PRODUCT_FLAG(bool, ScavengeBeforeFullGC, true, JVMFlag::DEFAULT, "Scavenge youngest generation before each full GC."); PRODUCT_FLAG(bool, ExplicitGCInvokesConcurrent, false, JVMFlag::DEFAULT, "A System.gc() request invokes a concurrent collection; " "(effective only when using concurrent collectors)"); PRODUCT_FLAG(uintx, GCLockerEdenExpansionPercent, 5, JVMFlag::RANGE, "How much the GC can expand the eden by while the GC locker " "is active (as a percentage)"); FLAG_RANGE( GCLockerEdenExpansionPercent, 0, 100); PRODUCT_FLAG(uintx, GCLockerRetryAllocationCount, 2, JVMFlag::DIAGNOSTIC | JVMFlag::RANGE, "Number of times to retry allocations when " "blocked by the GC locker"); FLAG_RANGE( GCLockerRetryAllocationCount, 0, max_uintx); PRODUCT_FLAG(uintx, ParallelGCBufferWastePct, 10, JVMFlag::RANGE, "Wasted fraction of parallel allocation buffer"); FLAG_RANGE( ParallelGCBufferWastePct, 0, 100); PRODUCT_FLAG(uintx, TargetPLABWastePct, 10, JVMFlag::RANGE, "Target wasted space in last buffer as percent of overall " "allocation"); FLAG_RANGE( TargetPLABWastePct, 1, 100); PRODUCT_FLAG(uintx, PLABWeight, 75, JVMFlag::RANGE, "Percentage (0-100) used to weight the current sample when " "computing exponentially decaying average for ResizePLAB"); FLAG_RANGE( PLABWeight, 0, 100); PRODUCT_FLAG(bool, ResizePLAB, true, JVMFlag::DEFAULT, "Dynamically resize (survivor space) promotion LAB's"); PRODUCT_FLAG(int, ParGCArrayScanChunk, 50, JVMFlag::RANGE, "Scan a subset of object array and push remainder, if array is " "bigger than this"); FLAG_RANGE( ParGCArrayScanChunk, 1, max_jint/3); PRODUCT_FLAG(bool, AlwaysPreTouch, false, JVMFlag::DEFAULT, "Force all freshly committed pages to be pre-touched"); PRODUCT_FLAG(size_t, PreTouchParallelChunkSize, 1 * G, JVMFlag::RANGE, "Per-thread chunk size for parallel memory pre-touch."); FLAG_RANGE( PreTouchParallelChunkSize, 1, SIZE_MAX / 2); // where does the range max value of (max_jint - 1) come from? PRODUCT_FLAG(size_t, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M), JVMFlag::RANGE, "Maximum size of marking stack"); FLAG_RANGE( MarkStackSizeMax, 1, (max_jint - 1)); PRODUCT_FLAG(size_t, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M), JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Size of marking stack"); FLAG_RANGE( MarkStackSize, 1, (max_jint - 1)); FLAG_CONSTRAINT( MarkStackSize, (void*)MarkStackSizeConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(intx, RefDiscoveryPolicy, 0, JVMFlag::RANGE, "Select type of reference discovery policy: " "reference-based(0) or referent-based(1)"); //TODO: to avoid circular dependency, the min/max cannot be declared in header file //FLAG_RANGE( RefDiscoveryPolicy, ReferenceProcessor::DiscoveryPolicyMin,ReferenceProcessor::DiscoveryPolicyMax); PRODUCT_FLAG(bool, ParallelRefProcEnabled, false, JVMFlag::DEFAULT, "Enable parallel reference processing whenever possible"); PRODUCT_FLAG(bool, ParallelRefProcBalancingEnabled, true, JVMFlag::DEFAULT, "Enable balancing of reference processing queues"); PRODUCT_FLAG(size_t, ReferencesPerThread, 1000, JVMFlag::EXPERIMENTAL, "Ergonomically start one thread for this amount of " "references for reference processing if " "ParallelRefProcEnabled is true. Specify 0 to disable and " "use all threads."); PRODUCT_FLAG(uintx, InitiatingHeapOccupancyPercent, 45, JVMFlag::RANGE, "The percent occupancy (IHOP) of the current old generation " "capacity above which a concurrent mark cycle will be initiated " "Its value may change over time if adaptive IHOP is enabled, " "otherwise the value remains constant. " "In the latter case a value of 0 will result as frequent as " "possible concurrent marking cycles. A value of 100 disables " "concurrent marking. " "Fragmentation waste in the old generation is not considered " "free space in this calculation. (G1 collector only)"); FLAG_RANGE( InitiatingHeapOccupancyPercent, 0, 100); NOTPROD_FLAG(bool, ScavengeALot, false, JVMFlag::DEFAULT, "Force scavenge at every Nth exit from the runtime system " "(N=ScavengeALotInterval)"); DEVELOP_FLAG(bool, FullGCALot, false, JVMFlag::DEFAULT, "Force full gc at every Nth exit from the runtime system " "(N=FullGCALotInterval)"); NOTPROD_FLAG(bool, GCALotAtAllSafepoints, false, JVMFlag::DEFAULT, "Enforce ScavengeALot/GCALot at all potential safepoints"); NOTPROD_FLAG(bool, PromotionFailureALot, false, JVMFlag::DEFAULT, "Use promotion failure handling on every youngest generation " "collection"); DEVELOP_FLAG(uintx, PromotionFailureALotCount, 1000, JVMFlag::DEFAULT, "Number of promotion failures occurring at PLAB promotion " "attempts at young collectors"); DEVELOP_FLAG(uintx, PromotionFailureALotInterval, 5, JVMFlag::DEFAULT, "Total collections between promotion failures a lot"); PRODUCT_FLAG(uintx, WorkStealingSleepMillis, 1, JVMFlag::EXPERIMENTAL, "Sleep time when sleep is used for yields"); PRODUCT_FLAG(uintx, WorkStealingYieldsBeforeSleep, 5000, JVMFlag::EXPERIMENTAL, "Number of yields before a sleep is done during work stealing"); PRODUCT_FLAG(uintx, WorkStealingHardSpins, 4096, JVMFlag::EXPERIMENTAL, "Number of iterations in a spin loop between checks on " "time out of hard spin"); PRODUCT_FLAG(uintx, WorkStealingSpinToYieldRatio, 10, JVMFlag::EXPERIMENTAL, "Ratio of hard spins to calls to yield"); DEVELOP_FLAG(uintx, ObjArrayMarkingStride, 2048, JVMFlag::DEFAULT, "Number of object array elements to push onto the marking stack " "before pushing a continuation entry"); DEVELOP_FLAG(bool, MetadataAllocationFailALot, false, JVMFlag::DEFAULT, "Fail metadata allocations at intervals controlled by " "MetadataAllocationFailALotInterval"); DEVELOP_FLAG(uintx, MetadataAllocationFailALotInterval, 1000, JVMFlag::DEFAULT, "Metadata allocation failure a lot interval"); PRODUCT_FLAG(bool, ExecutingUnitTests, false, JVMFlag::DEFAULT, "Whether the JVM is running unit tests or not"); PRODUCT_FLAG_PD(bool, UseTLAB, JVMFlag::DEFAULT, "Use thread-local object allocation"); PRODUCT_FLAG_PD(bool, ResizeTLAB, JVMFlag::DEFAULT, "Dynamically resize TLAB size for threads"); PRODUCT_FLAG(bool, ZeroTLAB, false, JVMFlag::DEFAULT, "Zero out the newly created TLAB"); PRODUCT_FLAG(bool, TLABStats, true, JVMFlag::DEFAULT, "Provide more detailed and expensive TLAB statistics."); PRODUCT_FLAG_PD(bool, NeverActAsServerClassMachine, JVMFlag::DEFAULT, "Never act like a server-class machine"); PRODUCT_FLAG(bool, AlwaysActAsServerClassMachine, false, JVMFlag::DEFAULT, "Always act like a server-class machine"); PRODUCT_FLAG_PD(uint64_t, MaxRAM, JVMFlag::RANGE, "Real memory size (in bytes) used to set maximum heap size"); FLAG_RANGE( MaxRAM, 0, 0XFFFFFFFFFFFFFFFF); PRODUCT_FLAG(bool, AggressiveHeap, false, JVMFlag::DEFAULT, "Optimize heap options for long-running memory intensive apps"); PRODUCT_FLAG(size_t, ErgoHeapSizeLimit, 0, JVMFlag::RANGE, "Maximum ergonomically set heap size (in bytes); zero means use " "MaxRAM * MaxRAMPercentage / 100"); FLAG_RANGE( ErgoHeapSizeLimit, 0, max_uintx); PRODUCT_FLAG(uintx, MaxRAMFraction, 4, JVMFlag::RANGE, "Maximum fraction (1/n) of real memory used for maximum heap " "size. " "Deprecated, use MaxRAMPercentage instead"); FLAG_RANGE( MaxRAMFraction, 1, max_uintx); PRODUCT_FLAG(uintx, MinRAMFraction, 2, JVMFlag::RANGE, "Minimum fraction (1/n) of real memory used for maximum heap " "size on systems with small physical memory size. " "Deprecated, use MinRAMPercentage instead"); FLAG_RANGE( MinRAMFraction, 1, max_uintx); PRODUCT_FLAG(uintx, InitialRAMFraction, 64, JVMFlag::RANGE, "Fraction (1/n) of real memory used for initial heap size. " "Deprecated, use InitialRAMPercentage instead"); FLAG_RANGE( InitialRAMFraction, 1, max_uintx); PRODUCT_FLAG(double, MaxRAMPercentage, 25.0, JVMFlag::RANGE, "Maximum percentage of real memory used for maximum heap size"); FLAG_RANGE( MaxRAMPercentage, 0.0, 100.0); PRODUCT_FLAG(double, MinRAMPercentage, 50.0, JVMFlag::RANGE, "Minimum percentage of real memory used for maximum heap" "size on systems with small physical memory size"); FLAG_RANGE( MinRAMPercentage, 0.0, 100.0); PRODUCT_FLAG(double, InitialRAMPercentage, 1.5625, JVMFlag::RANGE, "Percentage of real memory used for initial heap size"); FLAG_RANGE( InitialRAMPercentage, 0.0, 100.0); PRODUCT_FLAG(int, ActiveProcessorCount, -1, JVMFlag::DEFAULT, "Specify the CPU count the VM should use and report as active"); DEVELOP_FLAG(uintx, MaxVirtMemFraction, 2, JVMFlag::DEFAULT, "Maximum fraction (1/n) of virtual memory used for ergonomically " "determining maximum heap size"); PRODUCT_FLAG(bool, UseAdaptiveSizePolicy, true, JVMFlag::DEFAULT, "Use adaptive generation sizing policies"); PRODUCT_FLAG(bool, UsePSAdaptiveSurvivorSizePolicy, true, JVMFlag::DEFAULT, "Use adaptive survivor sizing policies"); PRODUCT_FLAG(bool, UseAdaptiveGenerationSizePolicyAtMinorCollection, true, JVMFlag::DEFAULT, "Use adaptive young-old sizing policies at minor collections"); PRODUCT_FLAG(bool, UseAdaptiveGenerationSizePolicyAtMajorCollection, true, JVMFlag::DEFAULT, "Use adaptive young-old sizing policies at major collections"); PRODUCT_FLAG(bool, UseAdaptiveSizePolicyWithSystemGC, false, JVMFlag::DEFAULT, "Include statistics from System.gc() for adaptive size policy"); PRODUCT_FLAG(bool, UseAdaptiveGCBoundary, false, JVMFlag::DEFAULT, "Allow young-old boundary to move"); DEVELOP_FLAG(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1, JVMFlag::RANGE, "Resize the virtual spaces of the young or old generations"); FLAG_RANGE( PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1, 1); PRODUCT_FLAG(uintx, AdaptiveSizeThroughPutPolicy, 0, JVMFlag::RANGE, "Policy for changing generation size for throughput goals"); FLAG_RANGE( AdaptiveSizeThroughPutPolicy, 0, 1); PRODUCT_FLAG(uintx, AdaptiveSizePolicyInitializingSteps, 20, JVMFlag::RANGE, "Number of steps where heuristics is used before data is used"); FLAG_RANGE( AdaptiveSizePolicyInitializingSteps, 0, max_uintx); DEVELOP_FLAG(uintx, AdaptiveSizePolicyReadyThreshold, 5, JVMFlag::DEFAULT, "Number of collections before the adaptive sizing is started"); PRODUCT_FLAG(uintx, AdaptiveSizePolicyOutputInterval, 0, JVMFlag::RANGE, "Collection interval for printing information; zero means never"); FLAG_RANGE( AdaptiveSizePolicyOutputInterval, 0, max_uintx); PRODUCT_FLAG(bool, UseAdaptiveSizePolicyFootprintGoal, true, JVMFlag::DEFAULT, "Use adaptive minimum footprint as a goal"); PRODUCT_FLAG(uintx, AdaptiveSizePolicyWeight, 10, JVMFlag::RANGE, "Weight given to exponential resizing, between 0 and 100"); FLAG_RANGE( AdaptiveSizePolicyWeight, 0, 100); PRODUCT_FLAG(uintx, AdaptiveTimeWeight, 25, JVMFlag::RANGE, "Weight given to time in adaptive policy, between 0 and 100"); FLAG_RANGE( AdaptiveTimeWeight, 0, 100); PRODUCT_FLAG(uintx, PausePadding, 1, JVMFlag::RANGE, "How much buffer to keep for pause time"); FLAG_RANGE( PausePadding, 0, max_juint); PRODUCT_FLAG(uintx, PromotedPadding, 3, JVMFlag::RANGE, "How much buffer to keep for promotion failure"); FLAG_RANGE( PromotedPadding, 0, max_juint); PRODUCT_FLAG(uintx, SurvivorPadding, 3, JVMFlag::RANGE, "How much buffer to keep for survivor overflow"); FLAG_RANGE( SurvivorPadding, 0, max_juint); PRODUCT_FLAG(uintx, ThresholdTolerance, 10, JVMFlag::RANGE, "Allowed collection cost difference between generations"); FLAG_RANGE( ThresholdTolerance, 0, 100); PRODUCT_FLAG(uintx, AdaptiveSizePolicyCollectionCostMargin, 50, JVMFlag::RANGE, "If collection costs are within margin, reduce both by full " "delta"); FLAG_RANGE( AdaptiveSizePolicyCollectionCostMargin, 0, 100); PRODUCT_FLAG(uintx, YoungGenerationSizeIncrement, 20, JVMFlag::RANGE, "Adaptive size percentage change in young generation"); FLAG_RANGE( YoungGenerationSizeIncrement, 0, 100); PRODUCT_FLAG(uintx, YoungGenerationSizeSupplement, 80, JVMFlag::RANGE, "Supplement to YoungedGenerationSizeIncrement used at startup"); FLAG_RANGE( YoungGenerationSizeSupplement, 0, 100); PRODUCT_FLAG(uintx, YoungGenerationSizeSupplementDecay, 8, JVMFlag::RANGE, "Decay factor to YoungedGenerationSizeSupplement"); FLAG_RANGE( YoungGenerationSizeSupplementDecay, 1, max_uintx); PRODUCT_FLAG(uintx, TenuredGenerationSizeIncrement, 20, JVMFlag::RANGE, "Adaptive size percentage change in tenured generation"); FLAG_RANGE( TenuredGenerationSizeIncrement, 0, 100); PRODUCT_FLAG(uintx, TenuredGenerationSizeSupplement, 80, JVMFlag::RANGE, "Supplement to TenuredGenerationSizeIncrement used at startup"); FLAG_RANGE( TenuredGenerationSizeSupplement, 0, 100); PRODUCT_FLAG(uintx, TenuredGenerationSizeSupplementDecay, 2, JVMFlag::RANGE, "Decay factor to TenuredGenerationSizeIncrement"); FLAG_RANGE( TenuredGenerationSizeSupplementDecay, 1, max_uintx); PRODUCT_FLAG(uintx, MaxGCPauseMillis, max_uintx - 1, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Adaptive size policy maximum GC pause time goal in millisecond, " "or (G1 Only) the maximum GC time per MMU time slice"); FLAG_RANGE( MaxGCPauseMillis, 1, max_uintx - 1); FLAG_CONSTRAINT( MaxGCPauseMillis, (void*)MaxGCPauseMillisConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(uintx, GCPauseIntervalMillis, 0, JVMFlag::CONSTRAINT, "Time slice for MMU specification"); FLAG_CONSTRAINT( GCPauseIntervalMillis, (void*)GCPauseIntervalMillisConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(uintx, MaxGCMinorPauseMillis, max_uintx, JVMFlag::RANGE, "Adaptive size policy maximum GC minor pause time goal " "in millisecond"); FLAG_RANGE( MaxGCMinorPauseMillis, 0, max_uintx); PRODUCT_FLAG(uintx, GCTimeRatio, 99, JVMFlag::RANGE, "Adaptive size policy application time to GC time ratio"); FLAG_RANGE( GCTimeRatio, 0, max_juint); PRODUCT_FLAG(uintx, AdaptiveSizeDecrementScaleFactor, 4, JVMFlag::RANGE, "Adaptive size scale down factor for shrinking"); FLAG_RANGE( AdaptiveSizeDecrementScaleFactor, 1, max_uintx); PRODUCT_FLAG(bool, UseAdaptiveSizeDecayMajorGCCost, true, JVMFlag::DEFAULT, "Adaptive size decays the major cost for long major intervals"); PRODUCT_FLAG(uintx, AdaptiveSizeMajorGCDecayTimeScale, 10, JVMFlag::RANGE, "Time scale over which major costs decay"); FLAG_RANGE( AdaptiveSizeMajorGCDecayTimeScale, 0, max_uintx); PRODUCT_FLAG(uintx, MinSurvivorRatio, 3, JVMFlag::RANGE, "Minimum ratio of young generation/survivor space size"); FLAG_RANGE( MinSurvivorRatio, 3, max_uintx); PRODUCT_FLAG(uintx, InitialSurvivorRatio, 8, JVMFlag::RANGE, "Initial ratio of young generation/survivor space size"); FLAG_RANGE( InitialSurvivorRatio, 0, max_uintx); PRODUCT_FLAG(size_t, BaseFootPrintEstimate, 256*M, JVMFlag::RANGE, "Estimate of footprint other than Java Heap"); FLAG_RANGE( BaseFootPrintEstimate, 0, max_uintx); PRODUCT_FLAG(bool, UseGCOverheadLimit, true, JVMFlag::DEFAULT, "Use policy to limit of proportion of time spent in GC " "before an OutOfMemory error is thrown"); PRODUCT_FLAG(uintx, GCTimeLimit, 98, JVMFlag::RANGE, "Limit of the proportion of time spent in GC before " "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)"); FLAG_RANGE( GCTimeLimit, 0, 100); PRODUCT_FLAG(uintx, GCHeapFreeLimit, 2, JVMFlag::RANGE, "Minimum percentage of free space after a full GC before an " "OutOfMemoryError is thrown (used with GCTimeLimit)"); FLAG_RANGE( GCHeapFreeLimit, 0, 100); DEVELOP_FLAG(uintx, GCOverheadLimitThreshold, 5, JVMFlag::RANGE, "Number of consecutive collections before gc time limit fires"); FLAG_RANGE( GCOverheadLimitThreshold, 1, max_uintx); PRODUCT_FLAG(intx, PrefetchCopyIntervalInBytes, -1, JVMFlag::RANGE, "How far ahead to prefetch destination area (<= 0 means off)"); FLAG_RANGE( PrefetchCopyIntervalInBytes, -1, max_jint); PRODUCT_FLAG(intx, PrefetchScanIntervalInBytes, -1, JVMFlag::RANGE, "How far ahead to prefetch scan area (<= 0 means off)"); FLAG_RANGE( PrefetchScanIntervalInBytes, -1, max_jint); PRODUCT_FLAG(intx, PrefetchFieldsAhead, -1, JVMFlag::RANGE, "How many fields ahead to prefetch in oop scan (<= 0 means off)"); FLAG_RANGE( PrefetchFieldsAhead, -1, max_jint); PRODUCT_FLAG(bool, VerifyDuringStartup, false, JVMFlag::DIAGNOSTIC, "Verify memory system before executing any Java code " "during VM initialization"); PRODUCT_FLAG(bool, VerifyBeforeExit, trueInDebug, JVMFlag::DIAGNOSTIC, "Verify system before exiting"); PRODUCT_FLAG(bool, VerifyBeforeGC, false, JVMFlag::DIAGNOSTIC, "Verify memory system before GC"); PRODUCT_FLAG(bool, VerifyAfterGC, false, JVMFlag::DIAGNOSTIC, "Verify memory system after GC"); PRODUCT_FLAG(bool, VerifyDuringGC, false, JVMFlag::DIAGNOSTIC, "Verify memory system during GC (between phases)"); PRODUCT_FLAG(ccstr, VerifyGCType, "", JVMFlag::DIAGNOSTIC | JVMFlag::STRINGLIST, "GC type(s) to verify when Verify*GC is enabled." "Available types are collector specific."); PRODUCT_FLAG(ccstr, VerifySubSet, "", JVMFlag::DIAGNOSTIC | JVMFlag::STRINGLIST, "Memory sub-systems to verify when Verify*GC flag(s) " "are enabled. One or more sub-systems can be specified " "in a comma separated string. Sub-systems are: " "threads, heap, symbol_table, string_table, codecache, " "dictionary, classloader_data_graph, metaspace, jni_handles, " "codecache_oops"); PRODUCT_FLAG(bool, GCParallelVerificationEnabled, true, JVMFlag::DIAGNOSTIC, "Enable parallel memory system verification"); PRODUCT_FLAG(bool, DeferInitialCardMark, false, JVMFlag::DIAGNOSTIC, "When +ReduceInitialCardMarks, explicitly defer any that " "may arise from new_pre_store_barrier"); PRODUCT_FLAG(bool, UseCondCardMark, false, JVMFlag::DEFAULT, "Check for already marked card before updating card table"); PRODUCT_FLAG(bool, VerifyRememberedSets, false, JVMFlag::DIAGNOSTIC, "Verify GC remembered sets"); PRODUCT_FLAG(bool, VerifyObjectStartArray, true, JVMFlag::DIAGNOSTIC, "Verify GC object start array if verify before/after"); PRODUCT_FLAG(bool, DisableExplicitGC, false, JVMFlag::DEFAULT, "Ignore calls to System.gc()"); PRODUCT_FLAG(bool, PrintGC, false, JVMFlag::DEFAULT, "Print message at garbage collection. " "Deprecated, use -Xlog:gc instead."); PRODUCT_FLAG(bool, PrintGCDetails, false, JVMFlag::DEFAULT, "Print more details at garbage collection. " "Deprecated, use -Xlog:gc* instead."); DEVELOP_FLAG(intx, ConcGCYieldTimeout, 0, JVMFlag::RANGE, "If non-zero, assert that GC threads yield within this " "number of milliseconds"); FLAG_RANGE( ConcGCYieldTimeout, 0, max_intx); NOTPROD_FLAG(intx, ScavengeALotInterval, 1, JVMFlag::DEFAULT, "Interval between which scavenge will occur with +ScavengeALot"); NOTPROD_FLAG(intx, FullGCALotInterval, 1, JVMFlag::DEFAULT, "Interval between which full gc will occur with +FullGCALot"); NOTPROD_FLAG(intx, FullGCALotStart, 0, JVMFlag::DEFAULT, "For which invocation to start FullGCAlot"); NOTPROD_FLAG(intx, FullGCALotDummies, 32*K, JVMFlag::DEFAULT, "Dummy object allocated with +FullGCALot, forcing all objects " "to move"); // gc parameters PRODUCT_FLAG(size_t, MinHeapSize, 0, JVMFlag::CONSTRAINT, "Minimum heap size (in bytes); zero means use ergonomics"); FLAG_CONSTRAINT( MinHeapSize, (void*)MinHeapSizeConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(size_t, InitialHeapSize, 0, JVMFlag::CONSTRAINT, "Initial heap size (in bytes); zero means use ergonomics"); FLAG_CONSTRAINT( InitialHeapSize, (void*)InitialHeapSizeConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(size_t, MaxHeapSize, ScaleForWordSize(96*M), JVMFlag::CONSTRAINT, "Maximum heap size (in bytes)"); FLAG_CONSTRAINT( MaxHeapSize, (void*)MaxHeapSizeConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(size_t, SoftMaxHeapSize, 0, JVMFlag::MANAGEABLE | JVMFlag::CONSTRAINT, "Soft limit for maximum heap size (in bytes)"); FLAG_CONSTRAINT( SoftMaxHeapSize, (void*)SoftMaxHeapSizeConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(size_t, OldSize, ScaleForWordSize(4*M), JVMFlag::RANGE, "Initial tenured generation size (in bytes)"); FLAG_RANGE( OldSize, 0, max_uintx); PRODUCT_FLAG(size_t, NewSize, ScaleForWordSize(1*M), JVMFlag::CONSTRAINT, "Initial new generation size (in bytes)"); FLAG_CONSTRAINT( NewSize, (void*)NewSizeConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(size_t, MaxNewSize, max_uintx, JVMFlag::RANGE, "Maximum new generation size (in bytes), max_uintx means set " "ergonomically"); FLAG_RANGE( MaxNewSize, 0, max_uintx); PRODUCT_FLAG_PD(size_t, HeapBaseMinAddress, JVMFlag::CONSTRAINT, "OS specific low limit for heap base address"); FLAG_CONSTRAINT( HeapBaseMinAddress, (void*)HeapBaseMinAddressConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(size_t, PretenureSizeThreshold, 0, JVMFlag::RANGE, "Maximum size in bytes of objects allocated in DefNew " "generation; zero means no maximum"); FLAG_RANGE( PretenureSizeThreshold, 0, max_uintx); PRODUCT_FLAG(size_t, MinTLABSize, 2*K, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Minimum allowed TLAB size (in bytes)"); FLAG_RANGE( MinTLABSize, 1, max_uintx/2); FLAG_CONSTRAINT( MinTLABSize, (void*)MinTLABSizeConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(size_t, TLABSize, 0, JVMFlag::CONSTRAINT, "Starting TLAB size (in bytes); zero means set ergonomically"); FLAG_CONSTRAINT( TLABSize, (void*)TLABSizeConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(size_t, YoungPLABSize, 4096, JVMFlag::CONSTRAINT, "Size of young gen promotion LAB's (in HeapWords)"); FLAG_CONSTRAINT( YoungPLABSize, (void*)YoungPLABSizeConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(size_t, OldPLABSize, 1024, JVMFlag::CONSTRAINT, "Size of old gen promotion LAB's (in HeapWords)"); FLAG_CONSTRAINT( OldPLABSize, (void*)OldPLABSizeConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(uintx, TLABAllocationWeight, 35, JVMFlag::RANGE, "Allocation averaging weight"); FLAG_RANGE( TLABAllocationWeight, 0, 100); // Limit the lower bound of this flag to 1 as it is used // in a division expression. PRODUCT_FLAG(uintx, TLABWasteTargetPercent, 1, JVMFlag::RANGE, "Percentage of Eden that can be wasted"); FLAG_RANGE( TLABWasteTargetPercent, 1, 100); PRODUCT_FLAG(uintx, TLABRefillWasteFraction, 64, JVMFlag::RANGE, "Maximum TLAB waste at a refill (internal fragmentation)"); FLAG_RANGE( TLABRefillWasteFraction, 1, max_juint); PRODUCT_FLAG(uintx, TLABWasteIncrement, 4, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Increment allowed waste at slow allocation"); FLAG_RANGE( TLABWasteIncrement, 0, max_jint); FLAG_CONSTRAINT( TLABWasteIncrement, (void*)TLABWasteIncrementConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(uintx, SurvivorRatio, 8, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Ratio of eden/survivor space size"); FLAG_RANGE( SurvivorRatio, 1, max_uintx-2); FLAG_CONSTRAINT( SurvivorRatio, (void*)SurvivorRatioConstraintFunc, JVMFlag::AfterMemoryInit); PRODUCT_FLAG(uintx, NewRatio, 2, JVMFlag::RANGE, "Ratio of old/new generation sizes"); FLAG_RANGE( NewRatio, 0, max_uintx-1); PRODUCT_FLAG_PD(size_t, NewSizeThreadIncrease, JVMFlag::RANGE, "Additional size added to desired new generation size per " "non-daemon thread (in bytes)"); FLAG_RANGE( NewSizeThreadIncrease, 0, max_uintx); PRODUCT_FLAG(uintx, QueuedAllocationWarningCount, 0, JVMFlag::RANGE, "Number of times an allocation that queues behind a GC " "will retry before printing a warning"); FLAG_RANGE( QueuedAllocationWarningCount, 0, max_uintx); PRODUCT_FLAG(uintx, VerifyGCStartAt, 0, JVMFlag::DIAGNOSTIC | JVMFlag::RANGE, "GC invoke count where +VerifyBefore/AfterGC kicks in"); FLAG_RANGE( VerifyGCStartAt, 0, max_uintx); PRODUCT_FLAG(intx, VerifyGCLevel, 0, JVMFlag::DIAGNOSTIC | JVMFlag::RANGE, "Generation level at which to start +VerifyBefore/AfterGC"); FLAG_RANGE( VerifyGCLevel, 0, 1); PRODUCT_FLAG(uintx, MaxTenuringThreshold, 15, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Maximum value for tenuring threshold"); //TODO: to avoid circular dependency, the min/max cannot be declared in header file //FLAG_RANGE( MaxTenuringThreshold, 0, markWord::max_age + 1); FLAG_CONSTRAINT( MaxTenuringThreshold, (void*)MaxTenuringThresholdConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(uintx, InitialTenuringThreshold, 7, JVMFlag::RANGE | JVMFlag::CONSTRAINT, "Initial value for tenuring threshold"); //TODO: to avoid circular dependency, the min/max cannot be declared in header file //FLAG_RANGE( InitialTenuringThreshold, 0, markWord::max_age + 1); FLAG_CONSTRAINT( InitialTenuringThreshold, (void*)InitialTenuringThresholdConstraintFunc, JVMFlag::AfterErgo); PRODUCT_FLAG(uintx, TargetSurvivorRatio, 50, JVMFlag::RANGE, "Desired percentage of survivor space used after scavenge"); FLAG_RANGE( TargetSurvivorRatio, 0, 100); PRODUCT_FLAG(uintx, MarkSweepDeadRatio, 5, JVMFlag::RANGE, "Percentage (0-100) of the old gen allowed as dead wood. " "Serial mark sweep treats this as both the minimum and maximum " "value. " "Par compact uses a variable scale based on the density of the " "generation and treats this as the maximum value when the heap " "is either completely full or completely empty. Par compact " "also has a smaller default value; see arguments.cpp."); FLAG_RANGE( MarkSweepDeadRatio, 0, 100); PRODUCT_FLAG(uint, MarkSweepAlwaysCompactCount, 4, JVMFlag::RANGE, "How often should we fully compact the heap (ignoring the dead " "space parameters)"); FLAG_RANGE( MarkSweepAlwaysCompactCount, 1, max_juint); DEVELOP_FLAG(uintx, GCExpandToAllocateDelayMillis, 0, JVMFlag::DEFAULT, "Delay between expansion and allocation (in milliseconds)"); PRODUCT_FLAG(uintx, GCDrainStackTargetSize, 64, JVMFlag::RANGE, "Number of entries we will try to leave on the stack " "during parallel gc"); FLAG_RANGE( GCDrainStackTargetSize, 0, max_juint); #endif // SHARE_GC_SHARED_GC_GLOBALS_HPP