查看当前JVM运行参数
java -XX:+PrintFlagsFinal -version | findstr "GC"
java -XX:+PrintFlagsFinal -version | grep "GC"
PS C:\Users\meowr> java -XX:+PrintFlagsFinal -version | findstr "GC"
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product} {default}
uint ConcGCThreads = 3 {product} {ergonomic}
bool DisableExplicitGC = false {product} {default}
bool ExplicitGCInvokesConcurrent = false {product} {default}
uintx G1MixedGCCountTarget = 8 {product} {default}
uintx G1PeriodicGCInterval = 0 {manageable} {default}
bool G1PeriodicGCInvokesConcurrent = true {product} {default}
double G1PeriodicGCSystemLoadThreshold = 0.000000 {manageable} {default}
uint GCCardSizeInBytes = 512 {product} {default}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
uintx GCHeapFreeLimit = 2 {product} {default}
uintx GCLockerEdenExpansionPercent = 5 {product} {default}
uintx GCPauseIntervalMillis = 201 {product} {default}
uintx GCTimeLimit = 98 {product} {default}
uintx GCTimeRatio = 12 {product} {default}
bool HeapDumpAfterFullGC = false {manageable} {default}
bool HeapDumpBeforeFullGC = false {manageable} {default}
size_t HeapSizePerGCThread = 43620760 {product} {default}
uintx MaxGCMinorPauseMillis = 18446744073709551615 {product} {default}
uintx MaxGCPauseMillis = 200 {product} {default}
int ParGCArrayScanChunk = 50 {product} {default}
uintx ParallelGCBufferWastePct = 10 {product} {default}
uint ParallelGCThreads = 13 {product} {default}
bool PrintGC = false {product} {default}
bool PrintGCDetails = false {product} {default}
bool ScavengeBeforeFullGC = false {product} {default}
ccstr ShenandoahGCHeuristics = adaptive {product} {default}
ccstr ShenandoahGCMode = satb {product} {default}
bool UseAdaptiveSizeDecayMajorGCCost = true {product} {default}
bool UseAdaptiveSizePolicyWithSystemGC = false {product} {default}
bool UseDynamicNumberOfGCThreads = true {product} {default}
bool UseG1GC = true {product} {ergonomic}
bool UseGCOverheadLimit = true {product} {default}
openjdk version "21.0.8" 2025-07-15 LTS
OpenJDK Runtime Environment Corretto-21.0.8.9.1 (build 21.0.8+9-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.8.9.1 (build 21.0.8+9-LTS, mixed mode, sharing)
bool UseMaximumCompactionOnSystemGC = true {product} {default}
bool UseParallelGC = false {product} {default}
bool UseSerialGC = false {product} {default}
bool UseShenandoahGC = false {product} {default}
bool UseZGC = false {product} {default}

调优领域


-Xmn 新生代内存建议
