HotSpot JVM 常用配置设置
本文讨论的选项是针对HotSpot虚拟机的。
1、选项分类及语法
HotspotJVM提供以下三大类选项:
1.1、标准选项
这类选项的功能是很稳定的,在后续版本中也不太会发生变化。
运行java或者 java -help 可以看到所有的标准选项。
语法:所有的标准选项都是以 - 开头,比如-version,-server等。
1.2、X选项
这类选项的功能还是很稳定,但官方的说法是它们的行为可能会在后续版本中改变,也有可能不在后续版本中提供了.
运行 java-X 命令可以看到所有的X选项。
语法:这类选项都是以 -X 开头,比如-Xms。
1.3、XX选项
这类选项是属于实验性,主要是给JVM开发者用于开发和调试JVM的,在后续的版本中行为有可能会变化。
语法:
- 如果是布尔类型的选项,它的格式为-XX:+flag或者-XX:-flag,分别表示开启和关闭该选项。
- 针对非布尔类型的选项,它的格式为-XX:flag=value
2、常用配置
2.1、指定JVM运行模式
Hotspot JVM有两种类型,分别是server和client。
它们的区别是Server VM的初始堆空间会大一些,默认使用的是并行垃圾回收器,启动慢运行快。Client VM相对来讲会保守一些,初始堆空间会小一些,使用串行的垃圾回收器,它的目标是为了让JVM的启动速度更快,但运行速度会比Serverm模式慢些。
JVM在启动的时候会根据硬件和操作系统自动选择使用Server还是Client类型的JVM。
- 在32位Windows系统上,不论硬件配置如何,都默认使用Client类型的JVM。
- 在其他32位操作系统上,如果机器配置有2GB以上的内存同时有2个以上的CPU,则默认会使用Server类型的JVM
- 64位机器上只有Server类型的JVM。也就是说Client类型的JVM只在32位机器上提供。
- 也可以使用-server和-client选项来指定JVM的类型,不过只在32位的机器上有效,原因见上面一条。
更多详细内容可参见:http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html
2.2、指定JIT编译器模式
Java是一种解释型语言,但随着JIT技术的进步,它能在运行时将Java的字节码编译成本地代码。以下是几个相关的选项:
- -Xint表示禁用JIT,所有字节码都被解释执行,这个模式的速度最慢的。
- -Xcomp表示所有字节码都首先被编译成本地代码,然后再执行。
- -Xmixed,默认模式,让JIT根据程序运行的情况,有选择地将某些代码编译成本地代码。
-Xcomp和-Xmixed到底谁的速度快,针对不同的程序可能有不同的结果,基本还是推荐用默认模式。
2.3、查看Java版本
-version和-showversion
-version用于查看当前在使用什么版本的java及JRE、什么类型的JVM(Server/Client)、采用什么编译器模式。示例如下:
C:\Users\zsm>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
-showversion的作用是在运行一个程序时首先把上述信息打印出来,这样便于问题诊断。
建议Server类型的程序都把-showversion选项打开,这样可以发现一些配置问题,比如程序需要JDK1.7才能运行,而有的机器上装有多个JDK的版本,打开这个选项可以避免使用了错误版本的Java。
2.4、打印设置的XX选项及值
有三个选项:-XX:+PrintCommandLineFlags、-XX:+PrintFlagsInitial、-XX:+PrintFlagsFinal
-XX:+PrintCommandLineFlags:与-showversion类似,此选项可以在程序运行时首先打印出用户手动设置或者JVM自动设置的XX选项,建议加上这个选项以辅助问题诊断。
如下示例显示了JVM自动配置的初始和最大的HeapSize以及其他的一些选项:
C:\Users\zsm>java -XX:+PrintCommandLineFlags -version
-XX:InitialHeapSize=132712832 -XX:MaxHeapSize=2123405312 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
-XX:+PrintFlagsInitial:表示打印出所有XX选项的默认值。示例如下:
C:\Users\zsm>java -XX:+PrintFlagsInitial -version
[Global flags]
uintx AdaptiveSizeDecrementScaleFactor = 4 {product}
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product}
uintx AdaptiveSizePausePolicy = 0 {product}
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product}
uintx AdaptiveSizePolicyInitializingSteps = 20 {product}
uintx AdaptiveSizePolicyOutputInterval = 0 {product}
uintx AdaptiveSizePolicyWeight = 10 {product}
uintx AdaptiveSizeThroughPutPolicy = 0 {product}
uintx AdaptiveTimeWeight = 25 {product}
bool AdjustConcurrency = false {product}
bool AggressiveOpts = false {product}
intx AliasLevel = 3 {C2 product}
bool AlignVector = true {C2 product}
intx AllocateInstancePrefetchLines = 1 {product}
intx AllocatePrefetchDistance = -1 {product}
intx AllocatePrefetchInstr = 0 {product}
intx AllocatePrefetchLines = 3 {product}
intx AllocatePrefetchStepSize = 16 {product}
intx AllocatePrefetchStyle = 1 {product}
bool AllowJNIEnvProxy = false {product}
bool AllowNonVirtualCalls = false {product}
bool AllowParallelDefineClass = false {product}
bool AllowUserSignalHandlers = false {product}
bool AlwaysActAsServerClassMachine = false {product}
bool AlwaysCompileLoopMethods = false {product}
bool AlwaysLockClassLoader = false {product}
bool AlwaysPreTouch = false {product}
bool AlwaysRestoreFPU = false {product}
bool AlwaysTenure = false {product}
bool AssertOnSuspendWaitFailure = false {product}
bool AssumeMP = false {product}
intx AutoBoxCacheMax = 128 {C2 product}
uintx AutoGCSelectPauseMillis = 5000 {product}
intx BCEATraceLevel = 0 {product}
intx BackEdgeThreshold = 100000 {pd product}
bool BackgroundCompilation = true {pd product}
uintx BaseFootPrintEstimate = 268435456 {product}
intx BiasedLockingBulkRebiasThreshold = 20 {product}
intx BiasedLockingBulkRevokeThreshold = 40 {product}
intx BiasedLockingDecayTime = 25000 {product}
intx BiasedLockingStartupDelay = 4000 {product}
bool BindGCTaskThreadsToCPUs = false {product}
bool BlockLayoutByFrequency = true {C2 product}
intx BlockLayoutMinDiamondPercentage = 20 {C2 product}
bool BlockLayoutRotateLoops = true {C2 product}
bool BranchOnRegister = false {C2 product}
bool BytecodeVerificationLocal = false {product}
bool BytecodeVerificationRemote = true {product}
bool C1OptimizeVirtualCallProfiling = true {C1 product}
bool C1ProfileBranches = true {C1 product}
bool C1ProfileCalls = true {C1 product}
bool C1ProfileCheckcasts = true {C1 product}
bool C1ProfileInlinedCalls = true {C1 product}
bool C1ProfileVirtualCalls = true {C1 product}
bool C1UpdateMethodData = true {C1 product}
intx CICompilerCount = 2 {product}
bool CICompilerCountPerCPU = false {product}
bool CITime = false {product}
bool CMSAbortSemantics = false {product}
uintx CMSAbortablePrecleanMinWorkPerIteration = 100 {product}
intx CMSAbortablePrecleanWaitMillis = 100 {manageable}
uintx CMSBitMapYieldQuantum = 10485760 {product}
uintx CMSBootstrapOccupancy = 50 {product}
bool CMSClassUnloadingEnabled = true {product}
uintx CMSClassUnloadingMaxInterval = 0 {product}
bool CMSCleanOnEnter = true {product}
bool CMSCompactWhenClearAllSoftRefs = true {product}
uintx CMSConcMarkMultiple = 32 {product}
bool CMSConcurrentMTEnabled = true {product}
uintx CMSCoordinatorYieldSleepCount = 10 {product}
bool CMSDumpAtPromotionFailure = false {product}
bool CMSEdenChunksRecordAlways = true {product}
uintx CMSExpAvgFactor = 50 {product}
bool CMSExtrapolateSweep = false {product}
uintx CMSFullGCsBeforeCompaction = 0 {product}
uintx CMSIncrementalDutyCycle = 10 {product}
uintx CMSIncrementalDutyCycleMin = 0 {product}
bool CMSIncrementalMode = false {product}
uintx CMSIncrementalOffset = 0 {product}
bool CMSIncrementalPacing = true {product}
uintx CMSIncrementalSafetyFactor = 10 {product}
uintx CMSIndexedFreeListReplenish = 4 {product}
intx CMSInitiatingOccupancyFraction = -1 {product}
uintx CMSIsTooFullPercentage = 98 {product}
double CMSLargeCoalSurplusPercent = 0.950000 {product}
double CMSLargeSplitSurplusPercent = 1.000000 {product}
bool CMSLoopWarn = false {product}
uintx CMSMaxAbortablePrecleanLoops = 0 {product}
intx CMSMaxAbortablePrecleanTime = 5000 {product}
uintx CMSOldPLABMax = 1024 {product}
uintx CMSOldPLABMin = 16 {product}
uintx CMSOldPLABNumRefills = 4 {product}
uintx CMSOldPLABReactivityFactor = 2 {product}
bool CMSOldPLABResizeQuicker = false {product}
uintx CMSOldPLABToleranceFactor = 4 {product}
bool CMSPLABRecordAlways = true {product}
uintx CMSParPromoteBlocksToClaim = 16 {product}
bool CMSParallelInitialMarkEnabled = true {product}
bool CMSParallelRemarkEnabled = true {product}
bool CMSParallelSurvivorRemarkEnabled = true {product}
uintx CMSPrecleanDenominator = 3 {product}
uintx CMSPrecleanIter = 3 {product}
uintx CMSPrecleanNumerator = 2 {product}
bool CMSPrecleanRefLists1 = true {product}
bool CMSPrecleanRefLists2 = false {product}
bool CMSPrecleanSurvivors1 = false {product}
bool CMSPrecleanSurvivors2 = true {product}
uintx CMSPrecleanThreshold = 1000 {product}
bool CMSPrecleaningEnabled = true {product}
bool CMSPrintChunksInDump = false {product}
bool CMSPrintEdenSurvivorChunks = false {product}
bool CMSPrintObjectsInDump = false {product}
uintx CMSRemarkVerifyVariant = 1 {product}
bool CMSReplenishIntermediate = true {product}
uintx CMSRescanMultiple = 32 {product}
uintx CMSSamplingGrain = 16384 {product}
bool CMSScavengeBeforeRemark = false {product}
uintx CMSScheduleRemarkEdenPenetration = 50 {product}
uintx CMSScheduleRemarkEdenSizeThreshold = 2097152 {product}
uintx CMSScheduleRemarkSamplingRatio = 5 {product}
double CMSSmallCoalSurplusPercent = 1.050000 {product}
double CMSSmallSplitSurplusPercent = 1.100000 {product}
bool CMSSplitIndexedFreeListBlocks = true {product}
intx CMSTriggerInterval = -1 {manageable}
uintx CMSTriggerRatio = 80 {product}
intx CMSWaitDuration = 2000 {manageable}
uintx CMSWorkQueueDrainThreshold = 10 {product}
bool CMSYield = true {product}
uintx CMSYieldSleepCount = 0 {product}
uintx CMSYoungGenPerWorker = 67108864 {pd product}
uintx CMS_FLSPadding = 1 {product}
uintx CMS_FLSWeight = 75 {product}
uintx CMS_SweepPadding = 1 {product}
uintx CMS_SweepTimerThresholdMillis = 10 {product}
uintx CMS_SweepWeight = 75 {product}
bool CheckEndorsedAndExtDirs = false {product}
bool CheckJNICalls = false {product}
bool ClassUnloading = true {product}
bool ClassUnloadingWithConcurrentMark = true {product}
intx ClearFPUAtPark = 0 {product}
bool ClipInlining = true {product}
uintx CodeCacheExpansionSize = 65536 {pd product}
uintx CodeCacheMinimumFreeSpace = 512000 {product}
bool CollectGen0First = false {product}
bool CompactFields = true {product}
intx CompilationPolicyChoice = 0 {product}
ccstrlist CompileCommand = {product}
ccstr CompileCommandFile = {product}
ccstrlist CompileOnly = {product}
intx CompileThreshold = 10000 {pd product}
bool CompilerThreadHintNoPreempt = true {product}
intx CompilerThreadPriority = -1 {product}
intx CompilerThreadStackSize = 0 {pd product}
uintx CompressedClassSpaceSize = 1073741824 {product}
uintx ConcGCThreads = 0 {product}
intx ConditionalMoveLimit = 3 {C2 pd product}
intx ContendedPaddingWidth = 128 {product}
bool ConvertSleepToYield = true {pd product}
bool ConvertYieldToSleep = false {product}
bool CreateMinidumpOnCrash = false {product}
bool CriticalJNINatives = true {product}
bool DTraceAllocProbes = false {product}
bool DTraceMethodProbes = false {product}
bool DTraceMonitorProbes = false {product}
bool Debugging = false {product}
uintx DefaultMaxRAMFraction = 4 {product}
intx DefaultThreadPriority = -1 {product}
intx DeferPollingPageLoopCount = -1 {product}
intx DeferThrSuspendLoopCount = 4000 {product}
bool DeoptimizeRandom = false {product}
bool DisableAttachMechanism = false {product}
bool DisableExplicitGC = false {product}
bool DisplayVMOutputToStderr = false {product}
bool DisplayVMOutputToStdout = false {product}
bool DoEscapeAnalysis = true {C2 product}
bool DontCompileHugeMethods = true {product}
bool DontYieldALot = false {pd product}
ccstr DumpLoadedClassList = {product}
bool DumpReplayDataOnError = true {product}
bool DumpSharedSpaces = false {product}
bool EagerXrunInit = false {product}
intx EliminateAllocationArraySizeLimit = 64 {C2 product}
bool EliminateAllocations = true {C2 product}
bool EliminateAutoBox = true {C2 product}
bool EliminateLocks = true {C2 product}
bool EliminateNestedLocks = true {C2 product}
intx EmitSync = 0 {product}
bool EnableContended = true {product}
bool EnableSharedLookupCache = true {product}
bool EnableTracing = false {product}
uintx ErgoHeapSizeLimit = 0 {product}
ccstr ErrorFile = {product}
ccstr ErrorReportServer = {product}
double EscapeAnalysisTimeout = 20.000000 {C2 product}
bool EstimateArgEscape = true {product}
bool ExplicitGCInvokesConcurrent = false {product}
bool ExplicitGCInvokesConcurrentAndUnloadsClasses = false {product}
bool ExtendedDTraceProbes = false {product}
ccstr ExtraSharedClassListFile = {product}
bool FLSAlwaysCoalesceLarge = false {product}
uintx FLSCoalescePolicy = 2 {product}
double FLSLargestBlockCoalesceProximity = 0.990000 {product}
bool FailOverToOldVerifier = true {product}
bool FastTLABRefill = true {product}
intx FenceInstruction = 0 {ARCH product}
intx FieldsAllocationStyle = 1 {product}
bool FilterSpuriousWakeups = true {product}
ccstr FlightRecorderOptions = {product}
bool ForceNUMA = false {product}
bool ForceTimeHighResolution = false {product}
intx FreqInlineSize = 325 {pd product}
double G1ConcMarkStepDurationMillis = 10.000000 {product}
uintx G1ConcRSHotCardLimit = 4 {product}
uintx G1ConcRSLogCacheSize = 10 {product}
intx G1ConcRefinementGreenZone = 0 {product}
intx G1ConcRefinementRedZone = 0 {product}
intx G1ConcRefinementServiceIntervalMillis = 300 {product}
uintx G1ConcRefinementThreads = 0 {product}
intx G1ConcRefinementThresholdStep = 0 {product}
intx G1ConcRefinementYellowZone = 0 {product}
uintx G1ConfidencePercent = 50 {product}
uintx G1HeapRegionSize = 0 {product}
uintx G1HeapWastePercent = 5 {product}
uintx G1MixedGCCountTarget = 8 {product}
intx G1RSetRegionEntries = 0 {product}
uintx G1RSetScanBlockSize = 64 {product}
intx G1RSetSparseRegionEntries = 0 {product}
intx G1RSetUpdatingPauseTimePercent = 10 {product}
intx G1RefProcDrainInterval = 10 {product}
uintx G1ReservePercent = 10 {product}
uintx G1SATBBufferEnqueueingThresholdPercent = 60 {product}
intx G1SATBBufferSize = 1024 {product}
intx G1UpdateBufferSize = 256 {product}
bool G1UseAdaptiveConcRefinement = true {product}
uintx GCDrainStackTargetSize = 64 {product}
uintx GCHeapFreeLimit = 2 {product}
uintx GCLockerEdenExpansionPercent = 5 {product}
bool GCLockerInvokesConcurrent = false {product}
uintx GCLogFileSize = 8192 {product}
uintx GCPauseIntervalMillis = 0 {product}
uintx GCTaskTimeStampEntries = 200 {product}
uintx GCTimeLimit = 98 {product}
uintx GCTimeRatio = 99 {product}
uintx HeapBaseMinAddress = 2147483648 {pd product}
bool HeapDumpAfterFullGC = false {manageable}
bool HeapDumpBeforeFullGC = false {manageable}
bool HeapDumpOnOutOfMemoryError = false {manageable}
ccstr HeapDumpPath = {manageable}
uintx HeapFirstMaximumCompactionCount = 3 {product}
uintx HeapMaximumCompactionInterval = 20 {product}
uintx HeapSizePerGCThread = 87241520 {product}
bool IgnoreEmptyClassPaths = false {product}
bool IgnoreUnrecognizedVMOptions = false {product}
uintx IncreaseFirstTierCompileThresholdAt = 50 {product}
bool IncrementalInline = true {C2 product}
uintx InitialBootClassLoaderMetaspaceSize = 4194304 {product}
uintx InitialCodeCacheSize = 2555904 {pd product}
uintx InitialHeapSize = 0 {product}
uintx InitialRAMFraction = 64 {product}
uintx InitialSurvivorRatio = 8 {product}
uintx InitialTenuringThreshold = 7 {product}
uintx InitiatingHeapOccupancyPercent = 45 {product}
bool Inline = true {product}
ccstr InlineDataFile = {product}
intx InlineSmallCode = 1000 {pd product}
bool InlineSynchronizedMethods = true {C1 product}
bool InsertMemBarAfterArraycopy = true {C2 product}
intx InteriorEntryAlignment = 16 {C2 pd product}
intx InterpreterProfilePercentage = 33 {product}
bool JNIDetachReleasesMonitors = true {product}
bool JavaMonitorsInStackTrace = true {product}
intx JavaPriority10_To_OSPriority = -1 {product}
intx JavaPriority1_To_OSPriority = -1 {product}
intx JavaPriority2_To_OSPriority = -1 {product}
intx JavaPriority3_To_OSPriority = -1 {product}
intx JavaPriority4_To_OSPriority = -1 {product}
intx JavaPriority5_To_OSPriority = -1 {product}
intx JavaPriority6_To_OSPriority = -1 {product}
intx JavaPriority7_To_OSPriority = -1 {product}
intx JavaPriority8_To_OSPriority = -1 {product}
intx JavaPriority9_To_OSPriority = -1 {product}
bool LIRFillDelaySlots = false {C1 pd product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx LargePageSizeInBytes = 0 {product}
bool LazyBootClassLoader = true {product}
intx LiveNodeCountInliningCutoff = 40000 {C2 product}
bool LogCommercialFeatures = false {product}
intx LoopMaxUnroll = 16 {C2 product}
intx LoopOptsCount = 43 {C2 product}
intx LoopUnrollLimit = 60 {C2 pd product}
intx LoopUnrollMin = 4 {C2 product}
bool LoopUnswitching = true {C2 product}
bool ManagementServer = false {product}
uintx MarkStackSize = 4194304 {product}
uintx MarkStackSizeMax = 536870912 {product}
uintx MarkSweepAlwaysCompactCount = 4 {product}
uintx MarkSweepDeadRatio = 5 {product}
intx MaxBCEAEstimateLevel = 5 {product}
intx MaxBCEAEstimateSize = 150 {product}
uintx MaxDirectMemorySize = 0 {product}
bool MaxFDLimit = true {product}
uintx MaxGCMinorPauseMillis = 4294967295 {product}
uintx MaxGCPauseMillis = 4294967295 {product}
uintx MaxHeapFreeRatio = 70 {manageable}
uintx MaxHeapSize = 130862280 {product}
intx MaxInlineLevel = 9 {product}
intx MaxInlineSize = 35 {product}
intx MaxJNILocalCapacity = 65536 {product}
intx MaxJavaStackTraceDepth = 1024 {product}
intx MaxJumpTableSize = 65000 {C2 product}
intx MaxJumpTableSparseness = 5 {C2 product}
intx MaxLabelRootDepth = 1100 {C2 product}
intx MaxLoopPad = 15 {C2 product}
uintx MaxMetaspaceExpansion = 5452592 {product}
uintx MaxMetaspaceFreeRatio = 70 {product}
uintx MaxMetaspaceSize = 4294967295 {product}
uintx MaxNewSize = 4294967295 {product}
intx MaxNodeLimit = 80000 {C2 product}
uint64_t MaxRAM = 0 {pd product}
uintx MaxRAMFraction = 4 {product}
intx MaxRecursiveInlineLevel = 1 {product}
uintx MaxTenuringThreshold = 15 {product}
intx MaxTrivialSize = 6 {product}
intx MaxVectorSize = 32 {C2 product}
uintx MetaspaceSize = 21810376 {pd product}
bool MethodFlushing = true {product}
uintx MinHeapDeltaBytes = 170392 {product}
uintx MinHeapFreeRatio = 40 {manageable}
intx MinInliningThreshold = 250 {product}
intx MinJumpTableSize = 10 {C2 pd product}
uintx MinMetaspaceExpansion = 340784 {product}
uintx MinMetaspaceFreeRatio = 40 {product}
uintx MinRAMFraction = 2 {product}
uintx MinSurvivorRatio = 3 {product}
uintx MinTLABSize = 2048 {product}
intx MonitorBound = 0 {product}
bool MonitorInUseLists = false {product}
intx MultiArrayExpandLimit = 6 {C2 product}
bool MustCallLoadClassInternal = false {product}
uintx NUMAChunkResizeWeight = 20 {product}
uintx NUMAInterleaveGranularity = 2097152 {product}
uintx NUMAPageScanRate = 256 {product}
uintx NUMASpaceResizeRate = 1073741824 {product}
bool NUMAStats = false {product}
ccstr NativeMemoryTracking = off {product}
bool NeedsDeoptSuspend = false {pd product}
bool NeverActAsServerClassMachine = false {pd product}
bool NeverTenure = false {product}
uintx NewRatio = 2 {product}
uintx NewSize = 1363144 {product}
uintx NewSizeThreadIncrease = 5320 {pd product}
intx NmethodSweepActivity = 10 {product}
intx NmethodSweepCheckInterval = 5 {product}
intx NmethodSweepFraction = 16 {product}
intx NodeLimitFudgeFactor = 2000 {C2 product}
uintx NumberOfGCLogFiles = 0 {product}
intx NumberOfLoopInstrToAlign = 4 {C2 product}
intx ObjectAlignmentInBytes = 8 {lp64_product}
uintx OldPLABSize = 1024 {product}
uintx OldPLABWeight = 50 {product}
uintx OldSize = 5452592 {product}
bool OmitStackTraceInFastThrow = true {product}
ccstrlist OnError = {product}
ccstrlist OnOutOfMemoryError = {product}
intx OnStackReplacePercentage = 140 {pd product}
bool OptimizeFill = true {C2 product}
bool OptimizePtrCompare = true {C2 product}
bool OptimizeStringConcat = true {C2 product}
bool OptoBundling = false {C2 pd product}
intx OptoLoopAlignment = 16 {pd product}
bool OptoScheduling = false {C2 pd product}
uintx PLABWeight = 75 {product}
bool PSChunkLargeArrays = true {product}
intx ParGCArrayScanChunk = 50 {product}
uintx ParGCDesiredObjsFromOverflowList = 20 {product}
bool ParGCTrimOverflow = true {product}
bool ParGCUseLocalOverflow = false {product}
uintx ParallelGCBufferWastePct = 10 {product}
uintx ParallelGCThreads = 0 {product}
bool ParallelGCVerbose = false {product}
uintx ParallelOldDeadWoodLimiterMean = 50 {product}
uintx ParallelOldDeadWoodLimiterStdDev = 80 {product}
bool ParallelRefProcBalancingEnabled = true {product}
bool ParallelRefProcEnabled = false {product}
bool PartialPeelAtUnsignedTests = true {C2 product}
bool PartialPeelLoop = true {C2 product}
intx PartialPeelNewPhiDelta = 0 {C2 product}
uintx PausePadding = 1 {product}
intx PerBytecodeRecompilationCutoff = 200 {product}
intx PerBytecodeTrapLimit = 4 {product}
intx PerMethodRecompilationCutoff = 400 {product}
intx PerMethodTrapLimit = 100 {product}
bool PerfAllowAtExitRegistration = false {product}
bool PerfBypassFileSystemCheck = false {product}
intx PerfDataMemorySize = 32768 {product}
intx PerfDataSamplingInterval = 50 {product}
ccstr PerfDataSaveFile = {product}
bool PerfDataSaveToFile = false {product}
bool PerfDisableSharedMem = false {product}
intx PerfMaxStringConstLength = 1024 {product}
intx PreInflateSpin = 10 {pd product}
bool PreferInterpreterNativeStubs = false {pd product}
intx PrefetchCopyIntervalInBytes = -1 {product}
intx PrefetchFieldsAhead = -1 {product}
intx PrefetchScanIntervalInBytes = -1 {product}
bool PreserveAllAnnotations = false {product}
uintx PretenureSizeThreshold = 0 {product}
bool PrintAdaptiveSizePolicy = false {product}
bool PrintCMSInitiationStatistics = false {product}
intx PrintCMSStatistics = 0 {product}
bool PrintClassHistogram = false {manageable}
bool PrintClassHistogramAfterFullGC = false {manageable}
bool PrintClassHistogramBeforeFullGC = false {manageable}
bool PrintCodeCache = false {product}
bool PrintCodeCacheOnCompilation = false {product}
bool PrintCommandLineFlags = false {product}
bool PrintCompilation = false {product}
bool PrintConcurrentLocks = false {manageable}
intx PrintFLSCensus = 0 {product}
intx PrintFLSStatistics = 0 {product}
bool PrintFlagsFinal = false {product}
bool PrintFlagsInitial = false {product}
bool PrintGC = false {manageable}
bool PrintGCApplicationConcurrentTime = false {product}
bool PrintGCApplicationStoppedTime = false {product}
bool PrintGCCause = true {product}
bool PrintGCDateStamps = false {manageable}
bool PrintGCDetails = false {manageable}
bool PrintGCID = false {manageable}
bool PrintGCTaskTimeStamps = false {product}
bool PrintGCTimeStamps = false {manageable}
bool PrintHeapAtGC = false {product rw}
bool PrintHeapAtGCExtended = false {product rw}
bool PrintHeapAtSIGBREAK = true {product}
bool PrintJNIGCStalls = false {product}
bool PrintJNIResolving = false {product}
bool PrintOldPLAB = false {product}
bool PrintOopAddress = false {product}
bool PrintPLAB = false {product}
bool PrintParallelOldGCPhaseTimes = false {product}
bool PrintPromotionFailure = false {product}
bool PrintReferenceGC = false {product}
bool PrintSafepointStatistics = false {product}
intx PrintSafepointStatisticsCount = 300 {product}
intx PrintSafepointStatisticsTimeout = -1 {product}
bool PrintSharedArchiveAndExit = false {product}
bool PrintSharedDictionary = false {product}
bool PrintSharedSpaces = false {product}
bool PrintStringDeduplicationStatistics = false {product}
bool PrintStringTableStatistics = false {product}
bool PrintTLAB = false {product}
bool PrintTenuringDistribution = false {product}
bool PrintTieredEvents = false {product}
bool PrintVMOptions = false {product}
bool PrintVMQWaitTime = false {product}
bool PrintWarnings = true {product}
uintx ProcessDistributionStride = 4 {product}
bool ProfileInterpreter = true {pd product}
bool ProfileIntervals = false {product}
intx ProfileIntervalsTicks = 100 {product}
intx ProfileMaturityPercentage = 20 {product}
bool ProfileVM = false {product}
bool ProfilerPrintByteCodeStatistics = false {product}
bool ProfilerRecordPC = false {product}
uintx PromotedPadding = 3 {product}
uintx QueuedAllocationWarningCount = 0 {product}
uintx RTMRetryCount = 5 {ARCH product}
bool RangeCheckElimination = true {product}
intx ReadPrefetchInstr = 0 {ARCH product}
bool ReassociateInvariants = true {C2 product}
bool ReduceBulkZeroing = true {C2 product}
bool ReduceFieldZeroing = true {C2 product}
bool ReduceInitialCardMarks = true {C2 product}
bool ReduceSignalUsage = false {product}
intx RefDiscoveryPolicy = 0 {product}
bool ReflectionWrapResolutionErrors = true {product}
bool RegisterFinalizersAtInit = true {product}
bool RelaxAccessControlCheck = false {product}
ccstr ReplayDataFile = {product}
bool RequireSharedSpaces = false {product}
uintx ReservedCodeCacheSize = 50331648 {pd product}
bool ResizeOldPLAB = true {product}
bool ResizePLAB = true {product}
bool ResizeTLAB = true {pd product}
bool RestoreMXCSROnJNICalls = false {product}
bool RestrictContended = true {product}
bool RewriteBytecodes = true {pd product}
bool RewriteFrequentPairs = true {pd product}
intx SafepointPollOffset = 256 {C1 pd product}
intx SafepointSpinBeforeYield = 2000 {product}
bool SafepointTimeout = false {product}
intx SafepointTimeoutDelay = 10000 {product}
bool ScavengeBeforeFullGC = true {product}
intx SelfDestructTimer = 0 {product}
uintx SharedBaseAddress = 0 {product}
ccstr SharedClassListFile = {product}
uintx SharedMiscCodeSize = 122880 {product}
uintx SharedMiscDataSize = 4194304 {product}
uintx SharedReadOnlySize = 16777216 {product}
uintx SharedReadWriteSize = 16777216 {product}
bool ShowMessageBoxOnError = false {product}
intx SoftRefLRUPolicyMSPerMB = 1000 {product}
bool SpecialEncodeISOArray = true {C2 product}
bool SplitIfBlocks = true {C2 product}
intx StackRedPages = 1 {pd product}
intx StackShadowPages = 6 {pd product}
bool StackTraceInThrowable = true {product}
intx StackYellowPages = 3 {pd product}
bool StartAttachListener = false {product}
intx StarvationMonitorInterval = 200 {product}
bool StressLdcRewrite = false {product}
uintx StringDeduplicationAgeThreshold = 3 {product}
uintx StringTableSize = 60013 {product}
bool SuppressFatalErrorMessage = false {product}
uintx SurvivorPadding = 3 {product}
uintx SurvivorRatio = 8 {product}
intx SuspendRetryCount = 50 {product}
intx SuspendRetryDelay = 5 {product}
intx SyncFlags = 0 {product}
ccstr SyncKnobs = {product}
intx SyncVerbose = 0 {product}
uintx TLABAllocationWeight = 35 {product}
uintx TLABRefillWasteFraction = 64 {product}
uintx TLABSize = 0 {product}
bool TLABStats = true {product}
uintx TLABWasteIncrement = 4 {product}
uintx TLABWasteTargetPercent = 1 {product}
uintx TargetPLABWastePct = 10 {product}
uintx TargetSurvivorRatio = 50 {product}
uintx TenuredGenerationSizeIncrement = 20 {product}
uintx TenuredGenerationSizeSupplement = 80 {product}
uintx TenuredGenerationSizeSupplementDecay = 2 {product}
intx ThreadPriorityPolicy = 0 {product}
bool ThreadPriorityVerbose = false {product}
uintx ThreadSafetyMargin = 52428800 {product}
intx ThreadStackSize = 0 {pd product}
uintx ThresholdTolerance = 10 {product}
intx Tier0BackedgeNotifyFreqLog = 10 {product}
intx Tier0InvokeNotifyFreqLog = 7 {product}
intx Tier0ProfilingStartPercentage = 200 {product}
intx Tier23InlineeNotifyFreqLog = 20 {product}
intx Tier2BackEdgeThreshold = 0 {product}
intx Tier2BackedgeNotifyFreqLog = 14 {product}
intx Tier2CompileThreshold = 0 {product}
intx Tier2InvokeNotifyFreqLog = 11 {product}
intx Tier3BackEdgeThreshold = 60000 {product}
intx Tier3BackedgeNotifyFreqLog = 13 {product}
intx Tier3CompileThreshold = 2000 {product}
intx Tier3DelayOff = 2 {product}
intx Tier3DelayOn = 5 {product}
intx Tier3InvocationThreshold = 200 {product}
intx Tier3InvokeNotifyFreqLog = 10 {product}
intx Tier3LoadFeedback = 5 {product}
intx Tier3MinInvocationThreshold = 100 {product}
intx Tier4BackEdgeThreshold = 40000 {product}
intx Tier4CompileThreshold = 15000 {product}
intx Tier4InvocationThreshold = 5000 {product}
intx Tier4LoadFeedback = 3 {product}
intx Tier4MinInvocationThreshold = 600 {product}
bool TieredCompilation = true {pd product}
intx TieredCompileTaskTimeout = 50 {product}
intx TieredRateUpdateMaxTime = 25 {product}
intx TieredRateUpdateMinTime = 1 {product}
intx TieredStopAtLevel = 4 {product}
bool TimeLinearScan = false {C1 product}
bool TraceBiasedLocking = false {product}
bool TraceClassLoading = false {product rw}
bool TraceClassLoadingPreorder = false {product}
bool TraceClassPaths = false {product}
bool TraceClassResolution = false {product}
bool TraceClassUnloading = false {product rw}
bool TraceDynamicGCThreads = false {product}
bool TraceGen0Time = false {product}
bool TraceGen1Time = false {product}
ccstr TraceJVMTI = {product}
bool TraceLoaderConstraints = false {product rw}
bool TraceMetadataHumongousAllocation = false {product}
bool TraceMonitorInflation = false {product}
bool TraceParallelOldGCTasks = false {product}
intx TraceRedefineClasses = 0 {product}
bool TraceSafepointCleanupTime = false {product}
bool TraceSharedLookupCache = false {product}
bool TraceSuspendWaitFailures = false {product}
intx TrackedInitializationLimit = 50 {C2 product}
bool TransmitErrorReport = false {product}
bool TrapBasedNullChecks = false {pd product}
bool TrapBasedRangeChecks = false {C2 pd product}
intx TypeProfileArgsLimit = 2 {product}
uintx TypeProfileLevel = 111 {pd product}
intx TypeProfileMajorReceiverPercent = 90 {C2 product}
intx TypeProfileParmsLimit = 2 {product}
intx TypeProfileWidth = 2 {product}
intx UnguardOnExecutionViolation = 0 {product}
bool UnlinkSymbolsALot = false {product}
bool Use486InstrsOnly = false {ARCH product}
bool UseAES = false {product}
bool UseAESIntrinsics = false {product}
intx UseAVX = 99 {ARCH product}
bool UseAdaptiveGCBoundary = false {product}
bool UseAdaptiveGenerationSizePolicyAtMajorCollection = true {product}
bool UseAdaptiveGenerationSizePolicyAtMinorCollection = true {product}
bool UseAdaptiveNUMAChunkSizing = true {product}
bool UseAdaptiveSizeDecayMajorGCCost = true {product}
bool UseAdaptiveSizePolicy = true {product}
bool UseAdaptiveSizePolicyFootprintGoal = true {product}
bool UseAdaptiveSizePolicyWithSystemGC = false {product}
bool UseAddressNop = false {ARCH product}
bool UseAltSigs = false {product}
bool UseAutoGCSelectPolicy = false {product}
bool UseBMI1Instructions = false {ARCH product}
bool UseBMI2Instructions = false {ARCH product}
bool UseBiasedLocking = true {product}
bool UseBimorphicInlining = true {C2 product}
bool UseBoundThreads = true {product}
bool UseCLMUL = false {ARCH product}
bool UseCMSBestFit = true {product}
bool UseCMSCollectionPassing = true {product}
bool UseCMSCompactAtFullCollection = true {product}
bool UseCMSInitiatingOccupancyOnly = false {product}
bool UseCRC32Intrinsics = false {product}
bool UseCodeCacheFlushing = true {product}
bool UseCompiler = true {product}
bool UseCompilerSafepoints = true {product}
bool UseCompressedClassPointers = false {lp64_product}
bool UseCompressedOops = false {lp64_product}
bool UseConcMarkSweepGC = false {product}
bool UseCondCardMark = false {C2 product}
bool UseCountLeadingZerosInstruction = false {ARCH product}
bool UseCountTrailingZerosInstruction = false {ARCH product}
bool UseCounterDecay = true {product}
bool UseDivMod = true {C2 product}
bool UseDynamicNumberOfGCThreads = false {product}
bool UseFPUForSpilling = false {C2 product}
bool UseFastAccessorMethods = true {product}
bool UseFastEmptyMethods = true {product}
bool UseFastJNIAccessors = true {product}
bool UseFastStosb = false {ARCH product}
bool UseG1GC = false {product}
bool UseGCLogFileRotation = false {product}
bool UseGCOverheadLimit = true {product}
bool UseGCTaskAffinity = false {product}
bool UseHeavyMonitors = false {product}
bool UseInlineCaches = true {product}
bool UseInterpreter = true {product}
bool UseJumpTables = true {C2 product}
bool UseLWPSynchronization = true {product}
bool UseLargePages = false {pd product}
bool UseLargePagesInMetaspace = false {product}
bool UseLargePagesIndividualAllocation := false {pd product}
bool UseLockedTracing = false {product}
bool UseLoopCounter = true {product}
bool UseLoopInvariantCodeMotion = true {C1 product}
bool UseLoopPredicate = true {C2 product}
bool UseMathExactIntrinsics = true {C2 product}
bool UseMaximumCompactionOnSystemGC = true {product}
bool UseMembar = false {pd product}
bool UseMultiplyToLenIntrinsic = false {C2 product}
bool UseNUMA = false {product}
bool UseNUMAInterleaving = false {product}
bool UseNewLongLShift = false {ARCH product}
bool UseOSErrorReporting = false {pd product}
bool UseOldInlining = true {C2 product}
bool UseOnStackReplacement = true {pd product}
bool UseOnlyInlinedBimorphic = true {C2 product}
bool UseOptoBiasInlining = true {C2 product}
bool UsePSAdaptiveSurvivorSizePolicy = true {product}
bool UseParNewGC = false {product}
bool UseParallelGC = false {product}
bool UseParallelOldGC = false {product}
bool UsePerfData = true {product}
bool UsePopCountInstruction = false {product}
bool UseRDPCForConstantTableBase = false {C2 product}
bool UseRTMDeopt = false {ARCH product}
bool UseRTMLocking = false {ARCH product}
bool UseSHA = false {product}
bool UseSHA1Intrinsics = false {product}
bool UseSHA256Intrinsics = false {product}
bool UseSHA512Intrinsics = false {product}
intx UseSSE = 99 {product}
bool UseSSE42Intrinsics = false {product}
bool UseSerialGC = false {product}
bool UseSharedSpaces = true {product}
bool UseSignalChaining = true {product}
bool UseStoreImmI16 = true {ARCH product}
bool UseStringDeduplication = false {product}
bool UseSuperWord = true {C2 product}
bool UseTLAB = true {pd product}
bool UseThreadPriorities = true {pd product}
bool UseTypeProfile = true {product}
bool UseTypeSpeculation = true {C2 product}
bool UseUTCFileTimestamp = true {product}
bool UseUnalignedLoadStores = false {ARCH product}
bool UseVMInterruptibleIO = false {product}
bool UseXMMForArrayCopy = false {product}
bool UseXmmI2D = false {ARCH product}
bool UseXmmI2F = false {ARCH product}
bool UseXmmLoadAndClearUpper = true {ARCH product}
bool UseXmmRegToRegMoveAll = false {ARCH product}
bool VMThreadHintNoPreempt = false {product}
intx VMThreadPriority = -1 {product}
intx VMThreadStackSize = 0 {pd product}
intx ValueMapInitialSize = 11 {C1 product}
intx ValueMapMaxLoopSize = 8 {C1 product}
intx ValueSearchLimit = 1000 {C2 product}
bool VerifyMergedCPBytecodes = true {product}
bool VerifySharedSpaces = false {product}
intx WorkAroundNPTLTimedWaitHang = 1 {product}
uintx YoungGenerationSizeIncrement = 20 {product}
uintx YoungGenerationSizeSupplement = 80 {product}
uintx YoungGenerationSizeSupplementDecay = 8 {product}
uintx YoungPLABSize = 4096 {product}
bool ZeroTLAB = false {product}
intx hashCode = 5 {product}
-XX:+PrintFlagsFinal:表示打印出XX选项在运行程序时生效的值。示例如下:
C:\Users\zsm>java -XX:+PrintFlagsFinal -version
[Global flags]
uintx AdaptiveSizeDecrementScaleFactor = 4 {product}
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product}
uintx AdaptiveSizePausePolicy = 0 {product}
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product}
uintx AdaptiveSizePolicyInitializingSteps = 20 {product}
uintx AdaptiveSizePolicyOutputInterval = 0 {product}
uintx AdaptiveSizePolicyWeight = 10 {product}
uintx AdaptiveSizeThroughPutPolicy = 0 {product}
uintx AdaptiveTimeWeight = 25 {product}
bool AdjustConcurrency = false {product}
bool AggressiveOpts = false {product}
intx AliasLevel = 3 {C2 product}
bool AlignVector = true {C2 product}
intx AllocateInstancePrefetchLines = 1 {product}
intx AllocatePrefetchDistance = 256 {product}
intx AllocatePrefetchInstr = 0 {product}
intx AllocatePrefetchLines = 3 {product}
intx AllocatePrefetchStepSize = 64 {product}
intx AllocatePrefetchStyle = 1 {product}
bool AllowJNIEnvProxy = false {product}
bool AllowNonVirtualCalls = false {product}
bool AllowParallelDefineClass = false {product}
bool AllowUserSignalHandlers = false {product}
bool AlwaysActAsServerClassMachine = false {product}
bool AlwaysCompileLoopMethods = false {product}
bool AlwaysLockClassLoader = false {product}
bool AlwaysPreTouch = false {product}
bool AlwaysRestoreFPU = false {product}
bool AlwaysTenure = false {product}
bool AssertOnSuspendWaitFailure = false {product}
bool AssumeMP = false {product}
intx AutoBoxCacheMax = 128 {C2 product}
uintx AutoGCSelectPauseMillis = 5000 {product}
intx BCEATraceLevel = 0 {product}
intx BackEdgeThreshold = 100000 {pd product}
bool BackgroundCompilation = true {pd product}
uintx BaseFootPrintEstimate = 268435456 {product}
intx BiasedLockingBulkRebiasThreshold = 20 {product}
intx BiasedLockingBulkRevokeThreshold = 40 {product}
intx BiasedLockingDecayTime = 25000 {product}
intx BiasedLockingStartupDelay = 4000 {product}
bool BindGCTaskThreadsToCPUs = false {product}
bool BlockLayoutByFrequency = true {C2 product}
intx BlockLayoutMinDiamondPercentage = 20 {C2 product}
bool BlockLayoutRotateLoops = true {C2 product}
bool BranchOnRegister = false {C2 product}
bool BytecodeVerificationLocal = false {product}
bool BytecodeVerificationRemote = true {product}
bool C1OptimizeVirtualCallProfiling = true {C1 product}
bool C1ProfileBranches = true {C1 product}
bool C1ProfileCalls = true {C1 product}
bool C1ProfileCheckcasts = true {C1 product}
bool C1ProfileInlinedCalls = true {C1 product}
bool C1ProfileVirtualCalls = true {C1 product}
bool C1UpdateMethodData = true {C1 product}
intx CICompilerCount := 3 {product}
bool CICompilerCountPerCPU = true {product}
bool CITime = false {product}
bool CMSAbortSemantics = false {product}
uintx CMSAbortablePrecleanMinWorkPerIteration = 100 {product}
intx CMSAbortablePrecleanWaitMillis = 100 {manageable}
uintx CMSBitMapYieldQuantum = 10485760 {product}
uintx CMSBootstrapOccupancy = 50 {product}
bool CMSClassUnloadingEnabled = true {product}
uintx CMSClassUnloadingMaxInterval = 0 {product}
bool CMSCleanOnEnter = true {product}
bool CMSCompactWhenClearAllSoftRefs = true {product}
uintx CMSConcMarkMultiple = 32 {product}
bool CMSConcurrentMTEnabled = true {product}
uintx CMSCoordinatorYieldSleepCount = 10 {product}
bool CMSDumpAtPromotionFailure = false {product}
bool CMSEdenChunksRecordAlways = true {product}
uintx CMSExpAvgFactor = 50 {product}
bool CMSExtrapolateSweep = false {product}
uintx CMSFullGCsBeforeCompaction = 0 {product}
uintx CMSIncrementalDutyCycle = 10 {product}
uintx CMSIncrementalDutyCycleMin = 0 {product}
bool CMSIncrementalMode = false {product}
uintx CMSIncrementalOffset = 0 {product}
bool CMSIncrementalPacing = true {product}
uintx CMSIncrementalSafetyFactor = 10 {product}
uintx CMSIndexedFreeListReplenish = 4 {product}
intx CMSInitiatingOccupancyFraction = -1 {product}
uintx CMSIsTooFullPercentage = 98 {product}
double CMSLargeCoalSurplusPercent = 0.950000 {product}
double CMSLargeSplitSurplusPercent = 1.000000 {product}
bool CMSLoopWarn = false {product}
uintx CMSMaxAbortablePrecleanLoops = 0 {product}
intx CMSMaxAbortablePrecleanTime = 5000 {product}
uintx CMSOldPLABMax = 1024 {product}
uintx CMSOldPLABMin = 16 {product}
uintx CMSOldPLABNumRefills = 4 {product}
uintx CMSOldPLABReactivityFactor = 2 {product}
bool CMSOldPLABResizeQuicker = false {product}
uintx CMSOldPLABToleranceFactor = 4 {product}
bool CMSPLABRecordAlways = true {product}
uintx CMSParPromoteBlocksToClaim = 16 {product}
bool CMSParallelInitialMarkEnabled = true {product}
bool CMSParallelRemarkEnabled = true {product}
bool CMSParallelSurvivorRemarkEnabled = true {product}
uintx CMSPrecleanDenominator = 3 {product}
uintx CMSPrecleanIter = 3 {product}
uintx CMSPrecleanNumerator = 2 {product}
bool CMSPrecleanRefLists1 = true {product}
bool CMSPrecleanRefLists2 = false {product}
bool CMSPrecleanSurvivors1 = false {product}
bool CMSPrecleanSurvivors2 = true {product}
uintx CMSPrecleanThreshold = 1000 {product}
bool CMSPrecleaningEnabled = true {product}
bool CMSPrintChunksInDump = false {product}
bool CMSPrintEdenSurvivorChunks = false {product}
bool CMSPrintObjectsInDump = false {product}
uintx CMSRemarkVerifyVariant = 1 {product}
bool CMSReplenishIntermediate = true {product}
uintx CMSRescanMultiple = 32 {product}
uintx CMSSamplingGrain = 16384 {product}
bool CMSScavengeBeforeRemark = false {product}
uintx CMSScheduleRemarkEdenPenetration = 50 {product}
uintx CMSScheduleRemarkEdenSizeThreshold = 2097152 {product}
uintx CMSScheduleRemarkSamplingRatio = 5 {product}
double CMSSmallCoalSurplusPercent = 1.050000 {product}
double CMSSmallSplitSurplusPercent = 1.100000 {product}
bool CMSSplitIndexedFreeListBlocks = true {product}
intx CMSTriggerInterval = -1 {manageable}
uintx CMSTriggerRatio = 80 {product}
intx CMSWaitDuration = 2000 {manageable}
uintx CMSWorkQueueDrainThreshold = 10 {product}
bool CMSYield = true {product}
uintx CMSYieldSleepCount = 0 {product}
uintx CMSYoungGenPerWorker = 67108864 {pd product}
uintx CMS_FLSPadding = 1 {product}
uintx CMS_FLSWeight = 75 {product}
uintx CMS_SweepPadding = 1 {product}
uintx CMS_SweepTimerThresholdMillis = 10 {product}
uintx CMS_SweepWeight = 75 {product}
bool CheckEndorsedAndExtDirs = false {product}
bool CheckJNICalls = false {product}
bool ClassUnloading = true {product}
bool ClassUnloadingWithConcurrentMark = true {product}
intx ClearFPUAtPark = 0 {product}
bool ClipInlining = true {product}
uintx CodeCacheExpansionSize = 65536 {pd product}
uintx CodeCacheMinimumFreeSpace = 512000 {product}
bool CollectGen0First = false {product}
bool CompactFields = true {product}
intx CompilationPolicyChoice = 3 {product}
ccstrlist CompileCommand = {product}
ccstr CompileCommandFile = {product}
ccstrlist CompileOnly = {product}
intx CompileThreshold = 10000 {pd product}
bool CompilerThreadHintNoPreempt = true {product}
intx CompilerThreadPriority = -1 {product}
intx CompilerThreadStackSize = 0 {pd product}
uintx CompressedClassSpaceSize = 1073741824 {product}
uintx ConcGCThreads = 0 {product}
intx ConditionalMoveLimit = 3 {C2 pd product}
intx ContendedPaddingWidth = 128 {product}
bool ConvertSleepToYield = true {pd product}
bool ConvertYieldToSleep = false {product}
bool CreateMinidumpOnCrash = false {product}
bool CriticalJNINatives = true {product}
bool DTraceAllocProbes = false {product}
bool DTraceMethodProbes = false {product}
bool DTraceMonitorProbes = false {product}
bool Debugging = false {product}
uintx DefaultMaxRAMFraction = 4 {product}
intx DefaultThreadPriority = -1 {product}
intx DeferPollingPageLoopCount = -1 {product}
intx DeferThrSuspendLoopCount = 4000 {product}
bool DeoptimizeRandom = false {product}
bool DisableAttachMechanism = false {product}
bool DisableExplicitGC = false {product}
bool DisplayVMOutputToStderr = false {product}
bool DisplayVMOutputToStdout = false {product}
bool DoEscapeAnalysis = true {C2 product}
bool DontCompileHugeMethods = true {product}
bool DontYieldALot = false {pd product}
ccstr DumpLoadedClassList = {product}
bool DumpReplayDataOnError = true {product}
bool DumpSharedSpaces = false {product}
bool EagerXrunInit = false {product}
intx EliminateAllocationArraySizeLimit = 64 {C2 product}
bool EliminateAllocations = true {C2 product}
bool EliminateAutoBox = true {C2 product}
bool EliminateLocks = true {C2 product}
bool EliminateNestedLocks = true {C2 product}
intx EmitSync = 0 {product}
bool EnableContended = true {product}
bool EnableSharedLookupCache = true {product}
bool EnableTracing = false {product}
uintx ErgoHeapSizeLimit = 0 {product}
ccstr ErrorFile = {product}
ccstr ErrorReportServer = {product}
double EscapeAnalysisTimeout = 20.000000 {C2 product}
bool EstimateArgEscape = true {product}
bool ExplicitGCInvokesConcurrent = false {product}
bool ExplicitGCInvokesConcurrentAndUnloadsClasses = false {product}
bool ExtendedDTraceProbes = false {product}
ccstr ExtraSharedClassListFile = {product}
bool FLSAlwaysCoalesceLarge = false {product}
uintx FLSCoalescePolicy = 2 {product}
double FLSLargestBlockCoalesceProximity = 0.990000 {product}
bool FailOverToOldVerifier = true {product}
bool FastTLABRefill = true {product}
intx FenceInstruction = 0 {ARCH product}
intx FieldsAllocationStyle = 1 {product}
bool FilterSpuriousWakeups = true {product}
ccstr FlightRecorderOptions = {product}
bool ForceNUMA = false {product}
bool ForceTimeHighResolution = false {product}
intx FreqInlineSize = 325 {pd product}
double G1ConcMarkStepDurationMillis = 10.000000 {product}
uintx G1ConcRSHotCardLimit = 4 {product}
uintx G1ConcRSLogCacheSize = 10 {product}
intx G1ConcRefinementGreenZone = 0 {product}
intx G1ConcRefinementRedZone = 0 {product}
intx G1ConcRefinementServiceIntervalMillis = 300 {product}
uintx G1ConcRefinementThreads = 0 {product}
intx G1ConcRefinementThresholdStep = 0 {product}
intx G1ConcRefinementYellowZone = 0 {product}
uintx G1ConfidencePercent = 50 {product}
uintx G1HeapRegionSize = 0 {product}
uintx G1HeapWastePercent = 5 {product}
uintx G1MixedGCCountTarget = 8 {product}
intx G1RSetRegionEntries = 0 {product}
uintx G1RSetScanBlockSize = 64 {product}
intx G1RSetSparseRegionEntries = 0 {product}
intx G1RSetUpdatingPauseTimePercent = 10 {product}
intx G1RefProcDrainInterval = 10 {product}
uintx G1ReservePercent = 10 {product}
uintx G1SATBBufferEnqueueingThresholdPercent = 60 {product}
intx G1SATBBufferSize = 1024 {product}
intx G1UpdateBufferSize = 256 {product}
bool G1UseAdaptiveConcRefinement = true {product}
uintx GCDrainStackTargetSize = 64 {product}
uintx GCHeapFreeLimit = 2 {product}
uintx GCLockerEdenExpansionPercent = 5 {product}
bool GCLockerInvokesConcurrent = false {product}
uintx GCLogFileSize = 8192 {product}
uintx GCPauseIntervalMillis = 0 {product}
uintx GCTaskTimeStampEntries = 200 {product}
uintx GCTimeLimit = 98 {product}
uintx GCTimeRatio = 99 {product}
uintx HeapBaseMinAddress = 2147483648 {pd product}
bool HeapDumpAfterFullGC = false {manageable}
bool HeapDumpBeforeFullGC = false {manageable}
bool HeapDumpOnOutOfMemoryError = false {manageable}
ccstr HeapDumpPath = {manageable}
uintx HeapFirstMaximumCompactionCount = 3 {product}
uintx HeapMaximumCompactionInterval = 20 {product}
uintx HeapSizePerGCThread = 87241520 {product}
bool IgnoreEmptyClassPaths = false {product}
bool IgnoreUnrecognizedVMOptions = false {product}
uintx IncreaseFirstTierCompileThresholdAt = 50 {product}
bool IncrementalInline = true {C2 product}
uintx InitialBootClassLoaderMetaspaceSize = 4194304 {product}
uintx InitialCodeCacheSize = 2555904 {pd product}
uintx InitialHeapSize := 134217728 {product}
uintx InitialRAMFraction = 64 {product}
uintx InitialSurvivorRatio = 8 {product}
uintx InitialTenuringThreshold = 7 {product}
uintx InitiatingHeapOccupancyPercent = 45 {product}
bool Inline = true {product}
ccstr InlineDataFile = {product}
intx InlineSmallCode = 2000 {pd product}
bool InlineSynchronizedMethods = true {C1 product}
bool InsertMemBarAfterArraycopy = true {C2 product}
intx InteriorEntryAlignment = 16 {C2 pd product}
intx InterpreterProfilePercentage = 33 {product}
bool JNIDetachReleasesMonitors = true {product}
bool JavaMonitorsInStackTrace = true {product}
intx JavaPriority10_To_OSPriority = -1 {product}
intx JavaPriority1_To_OSPriority = -1 {product}
intx JavaPriority2_To_OSPriority = -1 {product}
intx JavaPriority3_To_OSPriority = -1 {product}
intx JavaPriority4_To_OSPriority = -1 {product}
intx JavaPriority5_To_OSPriority = -1 {product}
intx JavaPriority6_To_OSPriority = -1 {product}
intx JavaPriority7_To_OSPriority = -1 {product}
intx JavaPriority8_To_OSPriority = -1 {product}
intx JavaPriority9_To_OSPriority = -1 {product}
bool LIRFillDelaySlots = false {C1 pd product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx LargePageSizeInBytes = 0 {product}
bool LazyBootClassLoader = true {product}
intx LiveNodeCountInliningCutoff = 40000 {C2 product}
bool LogCommercialFeatures = false {product}
intx LoopMaxUnroll = 16 {C2 product}
intx LoopOptsCount = 43 {C2 product}
intx LoopUnrollLimit = 60 {C2 pd product}
intx LoopUnrollMin = 4 {C2 product}
bool LoopUnswitching = true {C2 product}
bool ManagementServer = false {product}
uintx MarkStackSize = 4194304 {product}
uintx MarkStackSizeMax = 536870912 {product}
uintx MarkSweepAlwaysCompactCount = 4 {product}
uintx MarkSweepDeadRatio = 1 {product}
intx MaxBCEAEstimateLevel = 5 {product}
intx MaxBCEAEstimateSize = 150 {product}
uintx MaxDirectMemorySize = 0 {product}
bool MaxFDLimit = true {product}
uintx MaxGCMinorPauseMillis = 4294967295 {product}
uintx MaxGCPauseMillis = 4294967295 {product}
uintx MaxHeapFreeRatio = 100 {manageable}
uintx MaxHeapSize := 2124414976 {product}
intx MaxInlineLevel = 9 {product}
intx MaxInlineSize = 35 {product}
intx MaxJNILocalCapacity = 65536 {product}
intx MaxJavaStackTraceDepth = 1024 {product}
intx MaxJumpTableSize = 65000 {C2 product}
intx MaxJumpTableSparseness = 5 {C2 product}
intx MaxLabelRootDepth = 1100 {C2 product}
intx MaxLoopPad = 11 {C2 product}
uintx MaxMetaspaceExpansion = 5451776 {product}
uintx MaxMetaspaceFreeRatio = 70 {product}
uintx MaxMetaspaceSize = 4294901760 {product}
uintx MaxNewSize := 707788800 {product}
intx MaxNodeLimit = 75000 {C2 product}
uint64_t MaxRAM = 0 {pd product}
uintx MaxRAMFraction = 4 {product}
intx MaxRecursiveInlineLevel = 1 {product}
uintx MaxTenuringThreshold = 15 {product}
intx MaxTrivialSize = 6 {product}
intx MaxVectorSize = 32 {C2 product}
uintx MetaspaceSize = 21807104 {pd product}
bool MethodFlushing = true {product}
uintx MinHeapDeltaBytes := 524288 {product}
uintx MinHeapFreeRatio = 0 {manageable}
intx MinInliningThreshold = 250 {product}
intx MinJumpTableSize = 10 {C2 pd product}
uintx MinMetaspaceExpansion = 339968 {product}
uintx MinMetaspaceFreeRatio = 40 {product}
uintx MinRAMFraction = 2 {product}
uintx MinSurvivorRatio = 3 {product}
uintx MinTLABSize = 2048 {product}
intx MonitorBound = 0 {product}
bool MonitorInUseLists = false {product}
intx MultiArrayExpandLimit = 6 {C2 product}
bool MustCallLoadClassInternal = false {product}
uintx NUMAChunkResizeWeight = 20 {product}
uintx NUMAInterleaveGranularity = 2097152 {product}
uintx NUMAPageScanRate = 256 {product}
uintx NUMASpaceResizeRate = 1073741824 {product}
bool NUMAStats = false {product}
ccstr NativeMemoryTracking = off {product}
bool NeedsDeoptSuspend = false {pd product}
bool NeverActAsServerClassMachine = false {pd product}
bool NeverTenure = false {product}
uintx NewRatio = 2 {product}
uintx NewSize := 44564480 {product}
uintx NewSizeThreadIncrease = 5320 {pd product}
intx NmethodSweepActivity = 10 {product}
intx NmethodSweepCheckInterval = 5 {product}
intx NmethodSweepFraction = 16 {product}
intx NodeLimitFudgeFactor = 2000 {C2 product}
uintx NumberOfGCLogFiles = 0 {product}
intx NumberOfLoopInstrToAlign = 4 {C2 product}
intx ObjectAlignmentInBytes = 8 {lp64_product}
uintx OldPLABSize = 1024 {product}
uintx OldPLABWeight = 50 {product}
uintx OldSize := 89653248 {product}
bool OmitStackTraceInFastThrow = true {product}
ccstrlist OnError = {product}
ccstrlist OnOutOfMemoryError = {product}
intx OnStackReplacePercentage = 140 {pd product}
bool OptimizeFill = true {C2 product}
bool OptimizePtrCompare = true {C2 product}
bool OptimizeStringConcat = true {C2 product}
bool OptoBundling = false {C2 pd product}
intx OptoLoopAlignment = 16 {pd product}
bool OptoScheduling = false {C2 pd product}
uintx PLABWeight = 75 {product}
bool PSChunkLargeArrays = true {product}
intx ParGCArrayScanChunk = 50 {product}
uintx ParGCDesiredObjsFromOverflowList = 20 {product}
bool ParGCTrimOverflow = true {product}
bool ParGCUseLocalOverflow = false {product}
uintx ParallelGCBufferWastePct = 10 {product}
uintx ParallelGCThreads = 4 {product}
bool ParallelGCVerbose = false {product}
uintx ParallelOldDeadWoodLimiterMean = 50 {product}
uintx ParallelOldDeadWoodLimiterStdDev = 80 {product}
bool ParallelRefProcBalancingEnabled = true {product}
bool ParallelRefProcEnabled = false {product}
bool PartialPeelAtUnsignedTests = true {C2 product}
bool PartialPeelLoop = true {C2 product}
intx PartialPeelNewPhiDelta = 0 {C2 product}
uintx PausePadding = 1 {product}
intx PerBytecodeRecompilationCutoff = 200 {product}
intx PerBytecodeTrapLimit = 4 {product}
intx PerMethodRecompilationCutoff = 400 {product}
intx PerMethodTrapLimit = 100 {product}
bool PerfAllowAtExitRegistration = false {product}
bool PerfBypassFileSystemCheck = false {product}
intx PerfDataMemorySize = 32768 {product}
intx PerfDataSamplingInterval = 50 {product}
ccstr PerfDataSaveFile = {product}
bool PerfDataSaveToFile = false {product}
bool PerfDisableSharedMem = false {product}
intx PerfMaxStringConstLength = 1024 {product}
intx PreInflateSpin = 10 {pd product}
bool PreferInterpreterNativeStubs = false {pd product}
intx PrefetchCopyIntervalInBytes = 576 {product}
intx PrefetchFieldsAhead = 1 {product}
intx PrefetchScanIntervalInBytes = 576 {product}
bool PreserveAllAnnotations = false {product}
uintx PretenureSizeThreshold = 0 {product}
bool PrintAdaptiveSizePolicy = false {product}
bool PrintCMSInitiationStatistics = false {product}
intx PrintCMSStatistics = 0 {product}
bool PrintClassHistogram = false {manageable}
bool PrintClassHistogramAfterFullGC = false {manageable}
bool PrintClassHistogramBeforeFullGC = false {manageable}
bool PrintCodeCache = false {product}
bool PrintCodeCacheOnCompilation = false {product}
bool PrintCommandLineFlags = false {product}
bool PrintCompilation = false {product}
bool PrintConcurrentLocks = false {manageable}
intx PrintFLSCensus = 0 {product}
intx PrintFLSStatistics = 0 {product}
bool PrintFlagsFinal := true {product}
bool PrintFlagsInitial = false {product}
bool PrintGC = false {manageable}
bool PrintGCApplicationConcurrentTime = false {product}
bool PrintGCApplicationStoppedTime = false {product}
bool PrintGCCause = true {product}
bool PrintGCDateStamps = false {manageable}
bool PrintGCDetails = false {manageable}
bool PrintGCID = false {manageable}
bool PrintGCTaskTimeStamps = false {product}
bool PrintGCTimeStamps = false {manageable}
bool PrintHeapAtGC = false {product rw}
bool PrintHeapAtGCExtended = false {product rw}
bool PrintHeapAtSIGBREAK = true {product}
bool PrintJNIGCStalls = false {product}
bool PrintJNIResolving = false {product}
bool PrintOldPLAB = false {product}
bool PrintOopAddress = false {product}
bool PrintPLAB = false {product}
bool PrintParallelOldGCPhaseTimes = false {product}
bool PrintPromotionFailure = false {product}
bool PrintReferenceGC = false {product}
bool PrintSafepointStatistics = false {product}
intx PrintSafepointStatisticsCount = 300 {product}
intx PrintSafepointStatisticsTimeout = -1 {product}
bool PrintSharedArchiveAndExit = false {product}
bool PrintSharedDictionary = false {product}
bool PrintSharedSpaces = false {product}
bool PrintStringDeduplicationStatistics = false {product}
bool PrintStringTableStatistics = false {product}
bool PrintTLAB = false {product}
bool PrintTenuringDistribution = false {product}
bool PrintTieredEvents = false {product}
bool PrintVMOptions = false {product}
bool PrintVMQWaitTime = false {product}
bool PrintWarnings = true {product}
uintx ProcessDistributionStride = 4 {product}
bool ProfileInterpreter = true {pd product}
bool ProfileIntervals = false {product}
intx ProfileIntervalsTicks = 100 {product}
intx ProfileMaturityPercentage = 20 {product}
bool ProfileVM = false {product}
bool ProfilerPrintByteCodeStatistics = false {product}
bool ProfilerRecordPC = false {product}
uintx PromotedPadding = 3 {product}
uintx QueuedAllocationWarningCount = 0 {product}
uintx RTMRetryCount = 5 {ARCH product}
bool RangeCheckElimination = true {product}
intx ReadPrefetchInstr = 0 {ARCH product}
bool ReassociateInvariants = true {C2 product}
bool ReduceBulkZeroing = true {C2 product}
bool ReduceFieldZeroing = true {C2 product}
bool ReduceInitialCardMarks = true {C2 product}
bool ReduceSignalUsage = false {product}
intx RefDiscoveryPolicy = 0 {product}
bool ReflectionWrapResolutionErrors = true {product}
bool RegisterFinalizersAtInit = true {product}
bool RelaxAccessControlCheck = false {product}
ccstr ReplayDataFile = {product}
bool RequireSharedSpaces = false {product}
uintx ReservedCodeCacheSize = 251658240 {pd product}
bool ResizeOldPLAB = true {product}
bool ResizePLAB = true {product}
bool ResizeTLAB = true {pd product}
bool RestoreMXCSROnJNICalls = false {product}
bool RestrictContended = true {product}
bool RewriteBytecodes = true {pd product}
bool RewriteFrequentPairs = true {pd product}
intx SafepointPollOffset = 256 {C1 pd product}
intx SafepointSpinBeforeYield = 2000 {product}
bool SafepointTimeout = false {product}
intx SafepointTimeoutDelay = 10000 {product}
bool ScavengeBeforeFullGC = true {product}
intx SelfDestructTimer = 0 {product}
uintx SharedBaseAddress = 0 {product}
ccstr SharedClassListFile = {product}
uintx SharedMiscCodeSize = 122880 {product}
uintx SharedMiscDataSize = 4194304 {product}
uintx SharedReadOnlySize = 16777216 {product}
uintx SharedReadWriteSize = 16777216 {product}
bool ShowMessageBoxOnError = false {product}
intx SoftRefLRUPolicyMSPerMB = 1000 {product}
bool SpecialEncodeISOArray = true {C2 product}
bool SplitIfBlocks = true {C2 product}
intx StackRedPages = 1 {pd product}
intx StackShadowPages = 6 {pd product}
bool StackTraceInThrowable = true {product}
intx StackYellowPages = 3 {pd product}
bool StartAttachListener = false {product}
intx StarvationMonitorInterval = 200 {product}
bool StressLdcRewrite = false {product}
uintx StringDeduplicationAgeThreshold = 3 {product}
uintx StringTableSize = 60013 {product}
bool SuppressFatalErrorMessage = false {product}
uintx SurvivorPadding = 3 {product}
uintx SurvivorRatio = 8 {product}
intx SuspendRetryCount = 50 {product}
intx SuspendRetryDelay = 5 {product}
intx SyncFlags = 0 {product}
ccstr SyncKnobs = {product}
intx SyncVerbose = 0 {product}
uintx TLABAllocationWeight = 35 {product}
uintx TLABRefillWasteFraction = 64 {product}
uintx TLABSize = 0 {product}
bool TLABStats = true {product}
uintx TLABWasteIncrement = 4 {product}
uintx TLABWasteTargetPercent = 1 {product}
uintx TargetPLABWastePct = 10 {product}
uintx TargetSurvivorRatio = 50 {product}
uintx TenuredGenerationSizeIncrement = 20 {product}
uintx TenuredGenerationSizeSupplement = 80 {product}
uintx TenuredGenerationSizeSupplementDecay = 2 {product}
intx ThreadPriorityPolicy = 0 {product}
bool ThreadPriorityVerbose = false {product}
uintx ThreadSafetyMargin = 52428800 {product}
intx ThreadStackSize = 0 {pd product}
uintx ThresholdTolerance = 10 {product}
intx Tier0BackedgeNotifyFreqLog = 10 {product}
intx Tier0InvokeNotifyFreqLog = 7 {product}
intx Tier0ProfilingStartPercentage = 200 {product}
intx Tier23InlineeNotifyFreqLog = 20 {product}
intx Tier2BackEdgeThreshold = 0 {product}
intx Tier2BackedgeNotifyFreqLog = 14 {product}
intx Tier2CompileThreshold = 0 {product}
intx Tier2InvokeNotifyFreqLog = 11 {product}
intx Tier3BackEdgeThreshold = 60000 {product}
intx Tier3BackedgeNotifyFreqLog = 13 {product}
intx Tier3CompileThreshold = 2000 {product}
intx Tier3DelayOff = 2 {product}
intx Tier3DelayOn = 5 {product}
intx Tier3InvocationThreshold = 200 {product}
intx Tier3InvokeNotifyFreqLog = 10 {product}
intx Tier3LoadFeedback = 5 {product}
intx Tier3MinInvocationThreshold = 100 {product}
intx Tier4BackEdgeThreshold = 40000 {product}
intx Tier4CompileThreshold = 15000 {product}
intx Tier4InvocationThreshold = 5000 {product}
intx Tier4LoadFeedback = 3 {product}
intx Tier4MinInvocationThreshold = 600 {product}
bool TieredCompilation = true {pd product}
intx TieredCompileTaskTimeout = 50 {product}
intx TieredRateUpdateMaxTime = 25 {product}
intx TieredRateUpdateMinTime = 1 {product}
intx TieredStopAtLevel = 4 {product}
bool TimeLinearScan = false {C1 product}
bool TraceBiasedLocking = false {product}
bool TraceClassLoading = false {product rw}
bool TraceClassLoadingPreorder = false {product}
bool TraceClassPaths = false {product}
bool TraceClassResolution = false {product}
bool TraceClassUnloading = false {product rw}
bool TraceDynamicGCThreads = false {product}
bool TraceGen0Time = false {product}
bool TraceGen1Time = false {product}
ccstr TraceJVMTI = {product}
bool TraceLoaderConstraints = false {product rw}
bool TraceMetadataHumongousAllocation = false {product}
bool TraceMonitorInflation = false {product}
bool TraceParallelOldGCTasks = false {product}
intx TraceRedefineClasses = 0 {product}
bool TraceSafepointCleanupTime = false {product}
bool TraceSharedLookupCache = false {product}
bool TraceSuspendWaitFailures = false {product}
intx TrackedInitializationLimit = 50 {C2 product}
bool TransmitErrorReport = false {product}
bool TrapBasedNullChecks = false {pd product}
bool TrapBasedRangeChecks = false {C2 pd product}
intx TypeProfileArgsLimit = 2 {product}
uintx TypeProfileLevel = 111 {pd product}
intx TypeProfileMajorReceiverPercent = 90 {C2 product}
intx TypeProfileParmsLimit = 2 {product}
intx TypeProfileWidth = 2 {product}
intx UnguardOnExecutionViolation = 0 {product}
bool UnlinkSymbolsALot = false {product}
bool Use486InstrsOnly = false {ARCH product}
bool UseAES = true {product}
bool UseAESIntrinsics = true {product}
intx UseAVX = 2 {ARCH product}
bool UseAdaptiveGCBoundary = false {product}
bool UseAdaptiveGenerationSizePolicyAtMajorCollection = true {product}
bool UseAdaptiveGenerationSizePolicyAtMinorCollection = true {product}
bool UseAdaptiveNUMAChunkSizing = true {product}
bool UseAdaptiveSizeDecayMajorGCCost = true {product}
bool UseAdaptiveSizePolicy = true {product}
bool UseAdaptiveSizePolicyFootprintGoal = true {product}
bool UseAdaptiveSizePolicyWithSystemGC = false {product}
bool UseAddressNop = true {ARCH product}
bool UseAltSigs = false {product}
bool UseAutoGCSelectPolicy = false {product}
bool UseBMI1Instructions = true {ARCH product}
bool UseBMI2Instructions = true {ARCH product}
bool UseBiasedLocking = true {product}
bool UseBimorphicInlining = true {C2 product}
bool UseBoundThreads = true {product}
bool UseCLMUL = true {ARCH product}
bool UseCMSBestFit = true {product}
bool UseCMSCollectionPassing = true {product}
bool UseCMSCompactAtFullCollection = true {product}
bool UseCMSInitiatingOccupancyOnly = false {product}
bool UseCRC32Intrinsics = true {product}
bool UseCodeCacheFlushing = true {product}
bool UseCompiler = true {product}
bool UseCompilerSafepoints = true {product}
bool UseCompressedClassPointers := true {lp64_product}
bool UseCompressedOops := true {lp64_product}
bool UseConcMarkSweepGC = false {product}
bool UseCondCardMark = false {C2 product}
bool UseCountLeadingZerosInstruction = true {ARCH product}
bool UseCountTrailingZerosInstruction = true {ARCH product}
bool UseCounterDecay = true {product}
bool UseDivMod = true {C2 product}
bool UseDynamicNumberOfGCThreads = false {product}
bool UseFPUForSpilling = true {C2 product}
bool UseFastAccessorMethods = false {product}
bool UseFastEmptyMethods = false {product}
bool UseFastJNIAccessors = true {product}
bool UseFastStosb = true {ARCH product}
bool UseG1GC = false {product}
bool UseGCLogFileRotation = false {product}
bool UseGCOverheadLimit = true {product}
bool UseGCTaskAffinity = false {product}
bool UseHeavyMonitors = false {product}
bool UseInlineCaches = true {product}
bool UseInterpreter = true {product}
bool UseJumpTables = true {C2 product}
bool UseLWPSynchronization = true {product}
bool UseLargePages = false {pd product}
bool UseLargePagesInMetaspace = false {product}
bool UseLargePagesIndividualAllocation := false {pd product}
bool UseLockedTracing = false {product}
bool UseLoopCounter = true {product}
bool UseLoopInvariantCodeMotion = true {C1 product}
bool UseLoopPredicate = true {C2 product}
bool UseMathExactIntrinsics = true {C2 product}
bool UseMaximumCompactionOnSystemGC = true {product}
bool UseMembar = false {pd product}
bool UseMultiplyToLenIntrinsic = true {C2 product}
bool UseNUMA = false {product}
bool UseNUMAInterleaving = false {product}
bool UseNewLongLShift = false {ARCH product}
bool UseOSErrorReporting = false {pd product}
bool UseOldInlining = true {C2 product}
bool UseOnStackReplacement = true {pd product}
bool UseOnlyInlinedBimorphic = true {C2 product}
bool UseOptoBiasInlining = true {C2 product}
bool UsePSAdaptiveSurvivorSizePolicy = true {product}
bool UseParNewGC = false {product}
bool UseParallelGC := true {product}
bool UseParallelOldGC = true {product}
bool UsePerfData = true {product}
bool UsePopCountInstruction = true {product}
bool UseRDPCForConstantTableBase = false {C2 product}
bool UseRTMDeopt = false {ARCH product}
bool UseRTMLocking = false {ARCH product}
bool UseSHA = false {product}
bool UseSHA1Intrinsics = false {product}
bool UseSHA256Intrinsics = false {product}
bool UseSHA512Intrinsics = false {product}
intx UseSSE = 4 {product}
bool UseSSE42Intrinsics = true {product}
bool UseSerialGC = false {product}
bool UseSharedSpaces = false {product}
bool UseSignalChaining = true {product}
bool UseStoreImmI16 = false {ARCH product}
bool UseStringDeduplication = false {product}
bool UseSuperWord = true {C2 product}
bool UseTLAB = true {pd product}
bool UseThreadPriorities = true {pd product}
bool UseTypeProfile = true {product}
bool UseTypeSpeculation = true {C2 product}
bool UseUTCFileTimestamp = true {product}
bool UseUnalignedLoadStores = false {ARCH product}
bool UseVMInterruptibleIO = false {product}
bool UseXMMForArrayCopy = true {product}
bool UseXmmI2D = false {ARCH product}
bool UseXmmI2F = false {ARCH product}
bool UseXmmLoadAndClearUpper = true {ARCH product}
bool UseXmmRegToRegMoveAll = true {ARCH product}
bool VMThreadHintNoPreempt = false {product}
intx VMThreadPriority = -1 {product}
intx VMThreadStackSize = 0 {pd product}
intx ValueMapInitialSize = 11 {C1 product}
intx ValueMapMaxLoopSize = 8 {C1 product}
intx ValueSearchLimit = 1000 {C2 product}
bool VerifyMergedCPBytecodes = true {product}
bool VerifySharedSpaces = false {product}
intx WorkAroundNPTLTimedWaitHang = 1 {product}
uintx YoungGenerationSizeIncrement = 20 {product}
uintx YoungGenerationSizeSupplement = 80 {product}
uintx YoungGenerationSizeSupplementDecay = 8 {product}
uintx YoungPLABSize = 4096 {product}
bool ZeroTLAB = false {product}
intx hashCode = 5 {product}
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
2.5、各区域内存大小设置
注:虚拟机启动时就会把参数中设定大小的内存全部划为私有,即使扩容前有一部分内存不会被用户代码用到,这部分内存也不会交给其他进程使用。
2.5.1、方法区
永久代(Java8之前,Java8中没有永久代概念,下面参数无效)
-XX:PermSize=256m:设置永久代初始值为256M。
-XX:MaxPermSize=256m:设置永久代最大值为256M。(同上)
元空间(Java8中)
-XX:MetaspaceSize,初始空间大小,达到该值就会触发垃圾收集器进行类型卸载,同时GC会对该值进行调整:如果释放了大量的空间,就适当降低该值;如果释放了很少的空间,那么在不超过MaxMetaspaceSize时,适当提高该值
-XX:MaxMetaspaceSize,最大空间,默认没有限制。
2.5.2、栈
-Xss128k:设置每个线程的栈大小。JDK5.0以后每个线程栈大小为1M,之前每个线程栈大小为256K。应当根据应用的线程所需内存大小进行调整。在相同物理内存下,减小这个值能生成更多的线程。但是操作系统对一个进程内的线程数还是有限制的,不能无限生成,经验值在3000~5000左右。需要注意的是:当这个值被设置的较大(例如>2MB)时将会在很大程度上降低系统的性能。
2.5.3、堆
-Xmx3550m:等价于-XX:MaxHeapSize,设置JVM最大堆内存为3550M。
-Xms3550m:等价于-XX:InitialHeapSize,设置JVM初始堆内存为3550M。此值可以设置与-Xmx相同,以避免每次垃圾回收完成后JVM重新分配内存。
-Xmn2g:设置年轻代大小为2G。在整个堆内存大小确定的情况下,增大年轻代将会减小年老代,反之亦然。此值关系到JVM垃圾回收,对系统性能影响较大,官方推荐配置为整个堆大小的3/8。
-XX:NewSize=1024m:设置年轻代初始值为1024M。
-XX:MaxNewSize=1024m:设置年轻代最大值为1024M。
-XX:SurvivorRatio=4:设置年轻代中Eden区与一个Survivor区的比值。表示Edgen为一个Survivor的4倍,即1个Survivor区占整个年轻代大小的1/6。
-XX:NewRatio=4:设置老年代与年轻代(包括1个Eden和2个Survivor区)的比值。表示老年代是年轻代的4倍。
-XX:PretenureSizeThreadshold=1024:设置让大于此阈值的对象直接分配在老年代(只对Serial、ParNew收集器有效),单位为字节
-XX:MaxTenuringThreshold=7:
表示一个对象如果在Survivor区移动了7次那下次MinorGC时就进入老年代。如果设置为0的话,则年轻代对象不经过Survivor区,直接进入年老代,对于需要大量常驻内存的应用,这样做可以提高效率。如果将此值设置为一个较大值,则年轻代对象会在Survivor区进行多次复制,这样可以增加对象在年轻代存活时间,增加对象在年轻代被垃圾回收的概率,减少Full GC的频率,可以在某种程度上提高服务稳定性。
-XX:+PrintTenuringDistribution:让JVM在每次MinorGC后打印出当前使用的Survivor中对象的年龄分布。示例:
Desired survivor size 75497472 bytes, new threshold 15 (max 15)
- age 1: 19321624 bytes, 19321624 total
- age 2: 79376 bytes, 19401000 total
- age 3: 2904256 bytes, 22305256 total
第一行显示Survivor容量及对象被移到老年代的年龄阈值。
第二行起,每行显示当前Survivor中某个年龄下对象的大小及小于等于该年龄的对象大小总和。因为目前Survivor空间中对象的大小22M小于期望Survivor空间的大小72M,所以没有对象会被移到老年代。
假设下一次MinorGC后的输出结果为:
Desired survivor size 75497472 bytes, new threshold 2 (max 15)
- age 1: 68407384 bytes, 68407384 total
- age 2: 12494576 bytes, 80901960 total
- age 3: 79376 bytes, 80981336 total
- age 4: 2904256 bytes, 83885592 total
上次MinorGC后还存活的对象在这次MinorGC年龄都增加了1,可以看到上次年龄为2和3的对象(对应在这次GC后的年龄为3和4)依然存在(大小未变),而一部分上次对象年龄为1的对象在这次GC时被回收了。同时可以看到这次新增了约68M的新对象。这次MinorGC后Survivor区域中对象总的大小为约83M,大于了期望的Survivor空间的大小72M,因此它就把对象移到老年代的年龄的阈值调整为2,在下次MinorGC时一部分对象就会被移到老年代了。
相关的调整选项有:
- -XX:InitialTenuringThreshold 表示对象被移到老年代的年龄阈值的初始值
- -XX:MaxTenuringThreshold 表示对象被移到老年代的年龄阈值的最大值
- -XX:TargetSurvivorRatio 表示MinorGC结束了Survivor区域中占用空间的期望比例。
这些参数的调节没有统一的标准,但是有两点可以借鉴:
1、如果Survivor中对象的年龄分布显示很多对象在经历了多次GC最终年龄达到了-XX:MaxTenuringThreshold才被移到老年代,这可能说明-XX:MaxTenuringThreshold设置得过大,也有可能是Survivor的空间过大。
2、如果-XX:MaxTenuringThreshold的值大于1,但是很多对象年龄都不大于1,那就得关注一下期望的Survivor空间。如果每次GC后Survivor中对象的大小都没有超过期望的Survivor空间大小,则说明GC工作得很好。反之,则说明可能Survivor空间小了,使得新生成的对象很快就被移到了老年代了。
2.5.4、直接内存
-XX:MaxDirectMemorySize:指定DirectMemory容量,若未指定,则默认与Java堆最大值一样。
每个进程能使用的内存大小受操作系统的限制,在堆等的内存大小不变时,配置的栈内存越小,能开启的线程数越多。
2.6、OutofMemory相关的选项
如果程序发生了OOM后,JVM可以配置一些选项来做些善后工作,比如把内存给dump下来以分析原因,或者自动采取一些别的动作。
- -XX:+HeapDumpOnOutOfMemoryError 表示在内存出现OOM的时候,把Heap转存(Dump)到文件以便后续分析,文件名通常是java_pid<pid>.hprof,其中pid为该程序的进程号。
- -XX:HeapDumpPath=<path> 用来指定heap转存文件的存储路径,需要指定的路径下有足够的空间来保存转存文件。
- -XX:OnOutOfMemoryError 用来指定一个可行性程序或者脚本的路径,当发生OOM的时候,去执行这个脚本。
比如,下面的命令可以使得在发生OOM的时候,Heap被转存到文件/tmp/heapdump.hprof,同时执行Home目录中的cleanup.sh文件:
java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump.hprof -XX:OnOutOfMemoryError ="sh ~/cleanup.sh" MyApp
2.7、收集器设置
2.7.1、吞吐量优先收集器的相关选项
衡量JVM垃圾收集器的两个基本指标是吞吐量和停顿时间。
吞吐量是指执行用户代码的时间占总的时间的比例,总的时间包括执行用户代码的时间和垃圾回收占用的时间。在垃圾回收的时候执行用户代码的线程必须暂停,这会导致程序暂时失去响应。停顿时间就是衡量垃圾回收时造成的用户线程暂停的时间。这两个指标在一定程度是相互矛盾的,不可能让一个程序的吞吐量很高的同时停顿时间也短,只能以优先选择一个目标或者折中一下。因此,不同的垃圾回收器会有不同的侧重点。
在Hotspot JVM中,侧重于吞吐量的垃圾回收器是Parallel Scavenge和Parallel Old,它的相关选项如下:
- -XX:+UseParallelOldGC 表示新生代和老生代都使用并行回收器,其中的Old表示老生代的意思,而不是旧的意思。
- -XX:ParallelGCThreads=n 表示配置多少个线程来回收垃圾。默认的配置是如果处理器的个数小于8,那么就是处理器的个数;如果处理器大于8,它的值就是3+5N/8。也可以根据程序的需要去设置这个值,比如你的机器有16核,上面有4个Java程序,那么设置将这个值设置为4比较合理,因为JVM不会去探测同一机器上有多少个Java程序。
- -XX:UseAdaptiveSizePolicy 表示是否开启自适应策略,打开这个开关后,JVM自动调节JVM的新生代大小,Eden和Survivor的比例等参数。用户只需要设置期望的吞吐量(-XX:GCTimeRatio)和期望的停顿时间(-XX:MaxGCPauseMillis)。然后,JVM会尽量去向用户期望的方向去优化。
此外,如果机器只有一个核的话,采用并行回收器可能得不偿失,因为多个回收线程会争抢CPU资源,反而造成更大的消耗。这时,就最好采用串行回收器,相关的参数是-XX:+UseSerialGC
2.7.2、CMS收集器
CMS收集器(ConcurrentMarkandSweep),是一个关注系统停顿时间的收集器。它的主要思想是把收集器分成了不同的阶段,其中某些阶段是可以用户程序并行的,从而减少了整体的系统停顿时间。它主要分成了以下几个阶段:
- 初始标记 initial mark
- 并发标记 concurrent mark
- 重新标记 remark
- 并发清理 concurrent clean
- 并发重置 concurrent reset
CMS虽然能减少系统的停顿时间,但是它也有其缺点:
1. 从它的名字可以看出,它是一个标记-清除收集器,也就说运行了一段时间后,内存会产生碎片,从而导致无法找到连续空间来分配大对象。
2. CMS收集器在运行过程中会占用一些内存,同时系统还在运行,如果系统产生新对象的速度比CMS清理的速度快的话,会导致CMS运行失败。
当上面的任何一种情况发生的时候,JVM就会触发一次Full GC,会导致JVM停顿较长时间。
它的相关选项如下:
- -XX:+UseConcMarkSweepGC 表示老年代开启CMS收集器,而新生代默认会使用并行收集器。
- -XX:ConcGCThreads 指定用多少个线程来执行CMS的并非阶段。
- -XX:CMSInitiatingOccupancyFraction 指定在老生代用掉多少内存后开始进行垃圾回收。与吞吐量优先的回收器不同的是,吞吐量优先的回收器在老生代内存用尽了以后才开始进行收集,这对CMS来讲是不行的,因为吞吐量优先的垃圾回收器运行的时候会停止所有用户线程,所以不会产生新的对象,而CMS运行的时候,用户线程还有可能产生新的对象,所以不能等到内存用光后才开始运行。比如-XX:CMSInitiatingOccupancyFraction=75表示老生代用掉75%后开始回收垃圾。默认值是68。
- -XX:+ExplicitGCInvokesConcurrent 如果在代码里面显式调用System.gc(),那么它还是会执行Full GC从而导致用户线程被暂停。采用这个选项使得显式触发GC的时候还是使用CMS收集器。
- -XX:+DisableExplicitGC 一个相关的选项,这个选项是禁止显式调用GC
2.8、GC日志相关的选项
分析GC问题不可避免地要查看GC日志,下面是一些GC日志相关的选项:
-XX:+PrintGC,等同于-verbose:gc 表示打开简化的GC日志,相关输出如下:
[GC 425355K->351685K(506816K), 0.2175300 secs]
[Full GC 500561K->456058K(506816K), 0.6421920 secs]
其中以GC开头的行表示发生了一次Minor GC,后面的数字表示收集前后Heap空间的占用量,圆括号里面表示Heap大小,最后的数字表示用了多少时间。比如:上面的例子中,表示在这次GC新生代空间占用从425355K降到了351685K,总的新生代空间为506816K,这次GC耗时0.22秒。
通过这个选项只能看到一些基本信息,而且所有收集器的输出在这个模式下都是一样的。
-XX:+PrintGCDetails 在发生垃圾回收时打印内存回收日志,并在进程退出时输出当前内存各区域分配情况。
-XX:+PrintGCTimeStamps 打印GC发生时相对于JVM启动时的时间。
-XX:+PrintGCDateStamps 打印出GC发生的具体时间。
比如,以下是-XX:+PrintGCTimeStamps的输出
0,185: [GC 66048K->53077K(251392K), 0,0977580 secs]
0,323: [GC 119125K->114661K(317440K), 0,1448850 secs]
0,603: [GC 246757K->243133K(375296K), 0,2860800 secs]
以下是两个都打开后的输出:
2014-12-26T17:52:38.613-0800: 3.395: [GC 139776K->58339K(506816K), 0.1442900 secs]
- -Xloggc:<file> 表示把GC日志写入到一个文件中去,而不是打印到标准输出中。
- -XX:+PrintHeapAtGC 每一次GC前和GC后,都打印堆信息。
- -XX:+TraceClassLoading 监控类的加载。会打印 [Opened C:\Program Files\java\jdk1.8.0_45\jre\lib\rt.jar] [Loaded java.lang.Object from C:\Program Files\java\jdk1.8.0_45\jre\lib\rt.jar]... 。
- -XX:+PrintGCApplicationStoppedTime 打印GC时线程的停顿时间,如: Total time for which application threads were stopped: 0.0000660 seconds, Stopping threads took: 0.0000134 seconds 。
需要注意的是:这些和GC日志相关的选项可以在JVM已经启动后再开启,可以通过jinfo这个工具去设置。具体可以参见jinfo的帮助文件。这样就可以在需要诊断问题的时候再开启GC日志。
最后给一个示例:
-Xmx3550m:设置JVM最大堆内存为3550M。
-Xms3550m:设置JVM初始堆内存为3550M。此值可以设置与-Xmx相同,以避免每次垃圾回收完成后JVM重新分配内存。
-Xss128k:设置每个线程的栈大小。JDK5.0以后每个线程栈大小为1M,之前每个线程栈大小为256K。应当根据应用的线程所需内存大小进行调整。在相同物理内存下,减小这个值能生成更多的线程。但是操作系统对一个进程内的线程数还是有限制的,不能无限生成,经验值在3000~5000左右。需要注意的是:当这个值被设置的较大(例如>2MB)时将会在很大程度上降低系统的性能。
-Xmn2g:设置年轻代大小为2G。在整个堆内存大小确定的情况下,增大年轻代将会减小年老代,反之亦然。此值关系到JVM垃圾回收,对系统性能影响较大,官方推荐配置为整个堆大小的3/8。
-XX:NewSize=1024m:设置年轻代初始值为1024M。
-XX:MaxNewSize=1024m:设置年轻代最大值为1024M。
-XX:PermSize=256m:设置持久代初始值为256M。
-XX:MaxPermSize=256m:设置持久代最大值为256M。
-XX:NewRatio=4:设置年轻代(包括1个Eden和2个Survivor区)与年老代的比值。表示年轻代比年老代为1:4。
-XX:SurvivorRatio=4:设置年轻代中Eden区与Survivor区的比值。表示2个Survivor区(JVM堆内存年轻代中默认有2个大小相等的Survivor区)与1个Eden区的比值为2:4,即1个Survivor区占整个年轻代大小的1/6。
-XX:MaxTenuringThreshold=7:表示一个对象如果在Survivor区(救助空间)移动了7次还没有被垃圾回收就进入年老代。如果设置为0的话,则年轻代对象不经过Survivor区,直接进入年老代,对于需要大量常驻内存的应用,这样做可以提高效率。如果将此值设置为一个较大值,则年轻代对象会在Survivor区进行多次复制,这样可以增加对象在年轻代存活时间,增加对象在年轻代被垃圾回收的概率,减少Full GC的频率,这样做可以在某种程度上提高服务稳定性。
3、Java代码获取JVM相关参数
可以借助java.lang.management.*:
java.lang.management: for monitoring and management of the Java virtual machine and other components in the Java runtime. It allows both local and remote monitoring and management of the running Java virtual machine.
代码示例:
package cn.edu.buaa.jvmbook;
2
3 import java.lang.management.CompilationMXBean;
4 import java.lang.management.GarbageCollectorMXBean;
5 import java.lang.management.ManagementFactory;
6 import java.lang.management.MemoryMXBean;
7 import java.lang.management.MemoryPoolMXBean;
8 import java.lang.management.MemoryUsage;
9 import java.lang.management.OperatingSystemMXBean;
10 import java.lang.management.RuntimeMXBean;
11 import java.lang.management.ThreadMXBean;
12 import java.util.List;
13
14 /**
15 * @author zsm
16 * @date 2017年1月9日 上午10:37:48
17 */
18 public class GetJVMParameter {
19 public static void main(String[] args) {
20
21 MemoryMXBean memorymbean = ManagementFactory.getMemoryMXBean();
22 MemoryUsage usage = memorymbean.getHeapMemoryUsage();
23 System.out.println("INIT HEAP: " + usage.getInit() / 1024 / 1024);
24 System.out.println("MAX HEAP: " + usage.getMax() / 1024 / 1024);
25 System.out.println("USE HEAP: " + usage.getUsed() / 1024 / 1024);
26 System.out.println("\nFull Information:");
27 System.out.println("Heap Memory Usage: " + memorymbean.getHeapMemoryUsage());
28 System.out.println("Non-Heap Memory Usage: " + memorymbean.getNonHeapMemoryUsage());
29
30 List<String> inputArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
31 System.out.println("===================java options=============== ");
32 System.out.println(inputArguments);
33
34 System.out.println("=======================通过java来获取相关系统状态============================ ");
35 System.out.println("当前堆内存大小totalMemory " + (int) Runtime.getRuntime().totalMemory() / 1024 / 1024 + " M");// 当前堆内存大小
36 System.out.println("空闲堆内存大小freeMemory " + (int) Runtime.getRuntime().freeMemory() / 1024 / 1024 + " M");// 空闲堆内存大小
37 System.out.println("最大可用总堆内存maxMemory " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + " M");// 最大可用总堆内存大小
38
39 System.out.println("=======================OperatingSystemMXBean============================ ");
40 OperatingSystemMXBean osm = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
41 // System.out.println(osm.getFreeSwapSpaceSize()/1024);
42 // System.out.println(osm.getFreePhysicalMemorySize()/1024);
43 // System.out.println(osm.getTotalPhysicalMemorySize()/1024);
44
45 // 获取操作系统相关信息
46 System.out.println("osm.getArch() " + osm.getArch());
47 System.out.println("osm.getAvailableProcessors() " + osm.getAvailableProcessors());
48 // System.out.println("osm.getCommittedVirtualMemorySize() "+osm.getCommittedVirtualMemorySize());
49 System.out.println("osm.getName() " + osm.getName());
50 // System.out.println("osm.getProcessCpuTime() "+osm.getProcessCpuTime());
51 System.out.println("osm.getVersion() " + osm.getVersion());
52 // 获取整个虚拟机内存使用情况
53 System.out.println("=======================MemoryMXBean============================ ");
54 MemoryMXBean mm = (MemoryMXBean) ManagementFactory.getMemoryMXBean();
55 System.out.println("getHeapMemoryUsage " + mm.getHeapMemoryUsage());
56 System.out.println("getNonHeapMemoryUsage " + mm.getNonHeapMemoryUsage());
57 // 获取各个线程的各种状态,CPU 占用情况,以及整个系统中的线程状况
58 System.out.println("=======================ThreadMXBean============================ ");
59 ThreadMXBean tm = (ThreadMXBean) ManagementFactory.getThreadMXBean();
60 System.out.println("getThreadCount " + tm.getThreadCount());
61 System.out.println("getPeakThreadCount " + tm.getPeakThreadCount());
62 System.out.println("getCurrentThreadCpuTime " + tm.getCurrentThreadCpuTime());
63 System.out.println("getDaemonThreadCount " + tm.getDaemonThreadCount());
64 System.out.println("getCurrentThreadUserTime " + tm.getCurrentThreadUserTime());
65
66 // 当前编译器情况
67 System.out.println("=======================CompilationMXBean============================ ");
68 CompilationMXBean gm = (CompilationMXBean) ManagementFactory.getCompilationMXBean();
69 System.out.println("getName " + gm.getName());
70 System.out.println("getTotalCompilationTime " + gm.getTotalCompilationTime());
71
72 // 获取多个内存池的使用情况
73 System.out.println("=======================MemoryPoolMXBean============================ ");
74 List<MemoryPoolMXBean> mpmList = ManagementFactory.getMemoryPoolMXBeans();
75 for (MemoryPoolMXBean mpm : mpmList) {
76 System.out.println("getUsage " + mpm.getUsage());
77 System.out.println("getMemoryManagerNames " + mpm.getMemoryManagerNames().toString());
78 }
79 // 获取GC的次数以及花费时间之类的信息
80 System.out.println("=======================GarbageCollectorMXBean============================ ");
81 List<GarbageCollectorMXBean> gcmList = ManagementFactory.getGarbageCollectorMXBeans();
82 for (GarbageCollectorMXBean gcm : gcmList) {
83 System.out.println("getName " + gcm.getName());
84 System.out.println("getMemoryPoolNames " + gcm.getMemoryPoolNames());
85 }
86 // 获取运行时信息
87 System.out.println("=======================RuntimeMXBean============================ ");
88 RuntimeMXBean rmb = (RuntimeMXBean) ManagementFactory.getRuntimeMXBean();
89 System.out.println("getClassPath " + rmb.getClassPath());
90 System.out.println("getLibraryPath " + rmb.getLibraryPath());
91 System.out.println("getVmVersion " + rmb.getVmVersion());
92
93 }
94 }
INIT HEAP: 16
MAX HEAP: 19
USE HEAP: 1 Full Information:
Heap Memory Usage: init = 16777216(16384K) used = 1175064(1147K) committed = 15728640(15360K) max = 19922944(19456K)
Non-Heap Memory Usage: init = 2555904(2496K) used = 4101808(4005K) committed = 8060928(7872K) max = -1(-1K)
===================java options===============
[-Xms15M, -Xmx20M, -Xmn10M, -XX:SurvivorRatio=8, -Dfile.encoding=GBK]
=======================通过java来获取相关系统状态============================
当前堆内存大小totalMemory 15 M
空闲堆内存大小freeMemory 13 M
最大可用总堆内存maxMemory 19 M
=======================OperatingSystemMXBean============================
osm.getArch() amd64
osm.getAvailableProcessors() 4
osm.getName() Windows 8.1
osm.getVersion() 6.3
=======================MemoryMXBean============================
getHeapMemoryUsage init = 16777216(16384K) used = 1175064(1147K) committed = 15728640(15360K) max = 19922944(19456K)
getNonHeapMemoryUsage init = 2555904(2496K) used = 4152552(4055K) committed = 8060928(7872K) max = -1(-1K)
=======================ThreadMXBean============================
getThreadCount 5
getPeakThreadCount 5
getCurrentThreadCpuTime 93750000
getDaemonThreadCount 4
getCurrentThreadUserTime 62500000
=======================CompilationMXBean============================
getName HotSpot 64-Bit Tiered Compilers
getTotalCompilationTime 4
=======================MemoryPoolMXBean============================
getUsage init = 2555904(2496K) used = 1133120(1106K) committed = 2555904(2496K) max = 251658240(245760K)
getMemoryManagerNames [Ljava.lang.String;@659e0bfd
getUsage init = 0(0K) used = 2795920(2730K) committed = 4980736(4864K) max = -1(-1K)
getMemoryManagerNames [Ljava.lang.String;@2a139a55
getUsage init = 0(0K) used = 305448(298K) committed = 524288(512K) max = 1073741824(1048576K)
getMemoryManagerNames [Ljava.lang.String;@15db9742
getUsage init = 8388608(8192K) used = 1175064(1147K) committed = 8388608(8192K) max = 8388608(8192K)
getMemoryManagerNames [Ljava.lang.String;@6d06d69c
getUsage init = 1048576(1024K) used = 0(0K) committed = 1048576(1024K) max = 1048576(1024K)
getMemoryManagerNames [Ljava.lang.String;@7852e922
getUsage init = 6291456(6144K) used = 0(0K) committed = 6291456(6144K) max = 10485760(10240K)
getMemoryManagerNames [Ljava.lang.String;@4e25154f
=======================GarbageCollectorMXBean============================
getName PS Scavenge
getMemoryPoolNames [Ljava.lang.String;@70dea4e
getName PS MarkSweep
getMemoryPoolNames [Ljava.lang.String;@5c647e05
=======================RuntimeMXBean============================
getClassPath D:\eclipse\workspace\svn_local\TestJustFor\bin
getLibraryPath C:\Program Files\java\jdk1.8.0_45\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/java/jdk1.8.0_45//bin/../jre/bin/server;C:/Program Files/java/jdk1.8.0_45//bin/../jre/bin;C:/Program Files/java/jdk1.8.0_45//bin/../jre/lib/amd64;D:\soft_install\ImageMagick-7.0.1-Q16;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\soft_install;D:\soft_install\svn\bin;C:\Program Files\java\jdk1.8.0_45\\bin;C:\Program Files\java\jdk1.8.0_45\\jre\bin;C:\Users\zsm\AppData\Local\atom\bin;D:\apache-maven-3.2.5\bin;D:\soft_install\cywin\bin;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;D:\soft_install\nodejs\;C:\Program Files (x86)\CMake\bin;D:\gradle-3.1-all\gradle-3.1\\bin;D:\soft_install\python\Scripts\;D:\soft_install\python\;C:\Users\zsm\AppData\Roaming\npm;D:\soft_install\Microsoft VS Code\bin;C:\Users\zsm\AppData\Local\Microsoft\WindowsApps;;D:\eclipse;;.
getVmVersion 25.45-b02
jinfo是jdk自带的命令,可以用来查看正在运行的Java应用程序的扩展参数,甚至支持在运行时,修改部分参数。
通常会先使用jps查看java进程的id,然后使用jinfo查看指定pid的jvm信息.
jps #通过jps来查看当前运行状态的虚拟机进程
查看jvm的参数
1
|
jinfo -flags process_id |
查看java系统参数
1
|
jinfo -sysprops process_id |
虚拟机的这些参数可以通过下面的命令查看:
1
|
java -XX:+PrintFlagsFinal -version | grep manageable |
除了通过启动脚本可以设置参数,PrintGC默认是打开的,因此我们只需要打开PrintGCDetails参数。
1
2
|
jinfo -flag +PrintGC 27250 jinfo -flag +PrintGCDetails 27250 |
如果需要关闭GC日志的打印,使用下面的命令:
1
2
|
jinfo -flag -PrintGC 27250 jinfo -flag -PrintGCDetails 27250 |
查看是否开启了GC日志的打印:
1
2
|
jinfo -flag PrintGC 27250 jinfo -flag PrintGCDetails 27250 |
HotSpot JVM 常用配置设置的更多相关文章
- HotSpot JVM常用参数设置
转自:https://www.zybuluo.com/jewes/note/57352 选项的分类 Hotspot JVM提供以下三大类选项: 1. 标准选项:这类选项的功能是很稳定的,在后续版本中也 ...
- HotSpot JVM常用参数(选项)设置
本文讨论的选项是针对HotSpot虚拟机的. 1.选项分类及语法 HotspotJVM提供以下三大类选项: 1.1.标准选项 这类选项的功能是很稳定的,在后续版本中也不太会发生变化. 运行java或者 ...
- jvm常用参数设置 专题
在jdk8中 -Xms2g不合法,能通过的:-Xms2G #!/bin/bash JAVA_OPTS="-Xms4G -Xmx4G -XX:+HeapDumpOnOutOfMemoryErr ...
- JVM 常用配置
JVM的配置,最常用的两个配置就是:-Xms512m –Xmx1024m -Xms设置JVM的初始化内存大小,-Xmx为最大内存大小,当突破这个值,将会报内存溢出,导致的原因有很多,主要是虚拟机的回收 ...
- jvm常用参数设置 good
1.堆的大小可以通过 -Xms 和 -Xmx 来设置,一般将他们设置为相同的大小,目的是避免在每次垃圾回收后重新调整堆的大小,比如 -Xms=2g -Xmx=2g 或者 -Xms=512m -Xmx= ...
- JVM常用参数设置
堆内存设置 示例: java -Xmx4550m -Xms4550m -Xss128k -XX:NewRatio=5 -XX:SurvivorRatio=5 -Xmx4550m:设置JVM最大可用内存 ...
- 【JVM】6、聊聊JVM常用参数设置
整体考虑堆大小 -Xms3550m, 初始化堆大小.通常情况和-Xmx大小设置一样,避免虚拟机频繁自动计算后调整堆大小. -Xmx3550m,最大堆大小. 考虑分代设置堆大小 首先通过jstat等工具 ...
- JVM常用配置参数说明
堆设置 -Xms256M:初始堆大小256M,默认为物理内存的1/64 -Xmx1024M:最大堆大小1024M,默认为物理内存的1/4,等于与-XX:MaxHeapSize=64M -Xmn64M: ...
- Intellij Idea常用配置设置
1.配置Intellij Idea的配置文件从默认c盘转移到其他盘符 找到Intellij idea的安装文件,在bin目录下找到idea.properties配置文件,如下把Idea的配置文件夹和I ...
随机推荐
- 多线程之Timer和TimerTask
Timer是一种线程设施,用于安排以后在后台线程中执行的任务.可安排任务执行一次,或者定期重复执行,可以看成一个定时器,可以调度TimerTask.TimerTask是一个抽象类,实现了Runnabl ...
- C语言偏冷知识点汇总
1.C语言函数声明中参数类型写在右括号后是什么意思?如下代码所示: int add(a, b) int a; int b; { return a + b; } 像这样的声明是什么意思,我测试过在gcc ...
- PAT乙级1028
1028 人口普查 (20 分) 某城镇进行人口普查,得到了全体居民的生日.现请你写个程序,找出镇上最年长和最年轻的人. 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 ...
- Python学习笔记系列——九九乘法表&猜大小
再重新捡起Python,数据库短时间之内已经没啥看的了,不知道今年结束之前能不能Python入门,一直认为自己是没有编程思想的... 1.九九乘法表 #九九乘法表实现的一种方式之一 def Multi ...
- jlink RTT 打印 BUG , FreeRTOS 在开启 tickless 模式下 无法使用的问题
一开始我以为是 jlink 的问题,后面发现是 tickless 模式搞鬼 tickless 模式下 ,内核 会 根据任务需求,会停止工作,这个时候 jlink rtt 打印就会失效!!! 不过 NR ...
- 断言NSAssert的使用
1. NSAssert 断言(NSAssert)是一个宏,在开发过程中使用NSAssert可以及时发现程序中的问题. NSAssert声明如下: #define NSAssert(condition, ...
- [iOS]拾遗补阙
一.AFNetworking POST纯字符串 修改位置AFURLRequestSerialization 修改前 NSString * AFQueryStringFromParameters(NSD ...
- Datax3.0使用说明
一.datax3.0介绍 1.DataX 是一个异构数据源离线同步工具,致力于实现包括关系型数据库(MySQL.Oracle等).HDFS.Hive.ODPS.HBase.FTP等各种异构数据源之间稳 ...
- Verilog_Day2_Plus
内容为书中第4章 等式运算符 “==” 与 “===” 的区别 Verilog中存在4种等式运算符: == (等于); != (不等于); === (等于); !== (不等于). “==”与&quo ...
- 20145234黄斐《java程序设计》第十三周代码检查
在IDEA中对P145 MathTool.java 使用JUnit进行单元测试,测试用例不少于三个,要包含正常情况,边界情况. 提交测试代码和运行结果截图,加上学号水印,提交码云代码链接. 码云链接 ...