Skip to content

Instantly share code, notes, and snippets.

@yvvki
Last active December 4, 2024 09:31
Show Gist options
  • Save yvvki/f5d0c5c3b679ab8d2051083d810fe6e8 to your computer and use it in GitHub Desktop.
Save yvvki/f5d0c5c3b679ab8d2051083d810fe6e8 to your computer and use it in GitHub Desktop.
Minecraft Java flags I personally use

Minecraft Java Flags

Based of https://github.com/Mukul1127/Minecraft-Java-Flags.

Note

Replace -XX:+UseLargePages -XX:LargePageSizeInBytes=2m with -XX:+UseTransparentHugePages on Linux.

OpenJDK 11+ Client

-XX:+UnlockExperimentalVMOptions
-XX:+UnlockDiagnosticVMOptions
-XX:+AlwaysActAsServerClassMachine
-XX:+AlwaysPreTouch
-XX:+DisableExplicitGC
-XX:NmethodSweepActivity=1
-XX:ReservedCodeCacheSize=400M
-XX:NonNMethodCodeHeapSize=12M
-XX:ProfiledCodeHeapSize=194M
-XX:NonProfiledCodeHeapSize=194M
-XX:-DontCompileHugeMethods
-XX:MaxNodeLimit=240000
-XX:NodeLimitFudgeFactor=8000
-XX:+UseVectorCmov
-XX:+PerfDisableSharedMem
-XX:+UseFastUnorderedTimeStamps
-XX:+UseCriticalJavaThreadPriority
-XX:ThreadPriorityPolicy=1
-XX:+UseG1GC
-XX:MaxGCPauseMillis=37
-XX:+PerfDisableSharedMem
-XX:G1HeapRegionSize=16M
-XX:G1NewSizePercent=23
-XX:G1ReservePercent=20
-XX:SurvivorRatio=32
-XX:G1MixedGCCountTarget=3
-XX:G1HeapWastePercent=20
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5.0
-XX:GCTimeRatio=99
-XX:G1ConcRefinementServiceIntervalMillis=150
-XX:G1ConcRSHotCardLimit=16
-XX:AllocatePrefetchStyle=3
-XX:+UseLargePages
-XX:LargePageSizeInBytes=2m

OpenJDK 8 Client

-XX:+UnlockExperimentalVMOptions
-XX:+UnlockDiagnosticVMOptions
-XX:+AlwaysActAsServerClassMachine
-XX:+ParallelRefProcEnabled
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-XX:+PerfDisableSharedMem
-XX:+AggressiveOpts
-XX:+UseFastAccessorMethods
-XX:MaxInlineLevel=15
-XX:MaxVectorSize=32
-XX:+UseCompressedOops
-XX:ThreadPriorityPolicy=1
-XX:+UseDynamicNumberOfGCThreads
-XX:NmethodSweepActivity=1
-XX:ReservedCodeCacheSize=350M
-XX:-DontCompileHugeMethods
-XX:MaxNodeLimit=240000
-XX:NodeLimitFudgeFactor=8000
-XX:+UseFPUForSpilling
-XX:+UseG1GC
-XX:MaxGCPauseMillis=37
-XX:+PerfDisableSharedMem
-XX:G1HeapRegionSize=16M
-XX:G1NewSizePercent=23
-XX:G1ReservePercent=20
-XX:SurvivorRatio=32
-XX:G1MixedGCCountTarget=3
-XX:G1HeapWastePercent=20
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5.0
-XX:GCTimeRatio=99
-XX:G1ConcRefinementServiceIntervalMillis=150
-XX:G1ConcRSHotCardLimit=16
-XX:AllocatePrefetchStyle=3
-XX:+UseLargePages
-XX:LargePageSizeInBytes=2m

GraalVM 17+ Client

-XX:+UnlockExperimentalVMOptions
-XX:+UnlockDiagnosticVMOptions
-XX:+AlwaysActAsServerClassMachine
-XX:+AlwaysPreTouch
-XX:+DisableExplicitGC
-XX:NmethodSweepActivity=1
-XX:ReservedCodeCacheSize=400M
-XX:NonNMethodCodeHeapSize=12M
-XX:ProfiledCodeHeapSize=194M
-XX:NonProfiledCodeHeapSize=194M
-XX:-DontCompileHugeMethods
-XX:+PerfDisableSharedMem
-XX:+UseFastUnorderedTimeStamps
-XX:+UseCriticalJavaThreadPriority
-XX:+EagerJVMCI
-Dgraal.TuneInlinerExploration=1
-XX:+UseG1GC
-XX:MaxGCPauseMillis=37
-XX:+PerfDisableSharedMem
-XX:G1HeapRegionSize=16M
-XX:G1NewSizePercent=23
-XX:G1ReservePercent=20
-XX:SurvivorRatio=32
-XX:G1MixedGCCountTarget=3
-XX:G1HeapWastePercent=20
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5.0
-XX:GCTimeRatio=99
-XX:G1ConcRefinementServiceIntervalMillis=150
-XX:G1ConcRSHotCardLimit=16
-XX:AllocatePrefetchStyle=3
-XX:+UseLargePages
-XX:LargePageSizeInBytes=2m

GraalVM 17+ Server

-XX:+UnlockExperimentalVMOptions
-XX:+UnlockDiagnosticVMOptions
-XX:+AlwaysActAsServerClassMachine
-XX:+AlwaysPreTouch
-XX:+DisableExplicitGC
-XX:NmethodSweepActivity=1
-XX:ReservedCodeCacheSize=400M
-XX:NonNMethodCodeHeapSize=12M
-XX:ProfiledCodeHeapSize=194M
-XX:NonProfiledCodeHeapSize=194M
-XX:-DontCompileHugeMethods
-XX:+PerfDisableSharedMem
-XX:+UseFastUnorderedTimeStamps
-XX:+UseCriticalJavaThreadPriority
-XX:+EagerJVMCI
-Dgraal.TuneInlinerExploration=1
-XX:+UseG1GC
-XX:MaxGCPauseMillis=130
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-XX:G1NewSizePercent=28
-XX:G1HeapRegionSize=16M
-XX:G1ReservePercent=20
-XX:G1MixedGCCountTarget=3
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:SurvivorRatio=32
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5.0
-XX:G1ConcRefinementServiceIntervalMillis=150
-XX:G1ConcRSHotCardLimit=16
-XX:AllocatePrefetchStyle=3
-XX:+UseLargePages
-XX:LargePageSizeInBytes=2m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment