[0.18] Improving Performance - sainagh/meatballcraft GitHub Wiki
JVM Arguments [EASY]
JVM (Java Virtual Machine) arguments are 'Java settings' that can be added to make Meatballcraft run smoother!
For CurseForge
- Click the three dots next to the 'Play' button on Meatballcraft's page
- 'Profile Options'
- Scroll all the way to the bottom
- Copy and paste the arguments from this page (Option 1 or Option 2) into the 'Additional Arguments' field
For Prism
- Go to 'Settings'
- Go to 'Java'
- Set 'Maximum Memory Allocation' between 8 GB and 10 GB
- Copy and paste the arguments from this page (Option 1 or Option 2) into the 'JVM Arguments' field
- Add this JVM if you want to play in full screen
-Dorg.lwjgl.opengl.Window.undecorated=true
JVM Arguments
Option 1
-Xss4M -Dfile.encoding=GBK -XX:+AggressiveOpts -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSConcurrentMTEnabled -XX:ParallelGCThreads=8 -Dsun.rmi.dgc.server.gcInterval=1800000 -XX:+UnlockExperimentalVMOptions -XX:+ExplicitGCInvokesConcurrent -XX:MaxGCPauseMillis=50 -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -XX:+UseAdaptiveGCBoundary -XX:NewRatio=3 -Dfml.readTimeout=90 -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=75 -XX:+CMSScavengeBeforeRemark -XX:+UseCMSInitiatingOccupancyOnly
Option 2 (better on some computers)
-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+AggressiveOpts -XX:MaxInlineLevel=15 -XX:MaxVectorSize=32 -XX:+UseCompressedOops -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=300M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseFPUForSpilling -XX:+UseStringDeduplication -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:G1HeapRegionSize=32M -XX:G1NewSizePercent=23 -XX:G1MaxNewSizePercent=40 -XX:G1ReservePercent=20 -XX:SurvivorRatio=16 -XX:G1MixedGCCountTarget=3 -XX:G1MixedGCLiveThresholdPercent=90 -XX:InitiatingHeapOccupancyPercent=10 -XX:MaxTenuringThreshold=2 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:+ExplicitGCInvokesConcurrent
Upgrade to Java 25 [a bit harder]
NOTE: if you are doing this after updating from 0.17 and prior versions, it will still be faster and easier to set up 0.17 from scratch! Follow the steps here, and copy over your world, journeymap, and settings!
NOTE: sometimes Windows Defender will start a scan on an instance running on Cleanroom, which will consume lots of RAM and CPU, and this may have a negative effect on performance
Minecraft 1.12 runs on Java 8, which is old and slow. Upgrading to Java 25 makes it possible to get much faster loading times (almost twice as fast) and better FPS! This is done by using Cleanroom MMC, a forked version of forge developed by the Cleanroom group that works with more modern java versions!
To set things up your own way, please follow the steps here.
For a more automated setup on Linux, you can use the Python setup here!
Thanks to thermonuclear_minecraft_engineer for making this possible and to puddinpopper for testing out and fine-tuning these instructions!
Instructions for Curseforge
- Install Java 25 from this link [if you know what you are doing, JRE is harder to install but it performs better sometimes]
- Duplicate your Meatballcraft instance, just in case you mess things up: Meatballcraft page from the Curseforge app -> three dots on top right [next to the 'play' button] -> duplicate profile
- Enable Editing: Meatballcraft page from the Curseforge app -> three dots on top right [next to the 'play' button] -> Profile Options -> Allow content management for this profile
- Add Cleanroom relauncher to the pack: Meatballcraft page from the Curseforge app -> Add more content -> Search 'Cleanroom Relauncher' -> install
- Start the pack
- A window will open, select Cleanroom version alpha 0.3.0, and add the location of your Java instance [there is an auto-detect feature, it may not work if you have too many java versions on your computer]
- Launch
Instructions for Prism
- Install Prism Launcher [NOTE: make sure you are using Java x64, Java x32 will error out as a JVM issue with Prism]
- Download and install Meatballcraft using Prism
- Install Java 25 from this link [if you know what you are doing, JRE is harder to install but it performs better sometimes]
- Download this build of Cleanroom MMC
- In Prism, 'Add Instance' ➜ 'Import' ➜ Cleanroom_MMC.zip
- Edit the cleanroom instance ➜ 'Settings' ➜ 'Java Installation' ➜ set to your Java 25 path [Example directory C:/Program Files/Zulu/zulu-25/bin/java.exe].
- Allocate the same amount of ram for both memory settings (recommended 9000 Mb)
- Set Java Arguments to
-XX:+UseZGC -XX:+ZGenerational - Launch CleanroomMMC* instance once, and close it
- Transfer the content of Meatballcraft's .minecraft folder to cleanroom's .mincraft folder, consider using Link Shell Extension for a "Junction" [NOTE: make sure you do not delete or overwrite the existing Cleanroom files]
- [Optional] Change JVM arguments to the ones at the bottom of the page
- [Optional] Change your video settings after first launch: Fancy graphics. 4 mipmap. no clouds
- You can now lower the RAM allocation in Prism settings; from testing this can go as low as 5000 Mb, but it will depend on your computer, or it could be even lower!
Java 25 JVM Arguments
Option 1
-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -XX:MaxVectorSize=32 -XX:+UseCompressedOops -XX:ThreadPriorityPolicy=1 -XX:AllocatePrefetchStyle=3 -XX:+UseNUMA -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=300M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseFPUForSpilling -XX:+UseStringDeduplication -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:G1HeapRegionSize=32M -XX:G1NewSizePercent=23 -XX:G1MaxNewSizePercent=40 -XX:G1ReservePercent=20 -XX:SurvivorRatio=16 -XX:G1MixedGCCountTarget=3 -XX:G1MixedGCLiveThresholdPercent=90 -XX:InitiatingHeapOccupancyPercent=10 -XX:MaxTenuringThreshold=2 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:+ExplicitGCInvokesConcurrent
Option 2
-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -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:+UseZGC -XX:AllocatePrefetchStyle=1 -XX:+ZGenerational
Upgrade Server to Java 25
Java 25 can also be used on servers, if you self host them! It is possible to do with other platforms, but it will be harder than this guide! You can log into a Java 8 server using a Java 25 client anyway!
Thanks to ChaosStrikez for developing the startup scripts for this!
See the source repo if you need more details.
- Download the server files from CurseForge and extract the .zip in the desired folder
- Open
settings.cfg, setUSE_CLEANROOM=trueand select the right path for java 25 - In settings.cfg, set CLEANROOM_VER=0.3.0-alpha
- Start the server using
starter.baton Windows orServerStart.shon Linux (For Linux, you may need to runchmod +x ServerStart.shbefore executing.)
See this if you want to try different Java arguments. You would replace the existing arguments after JAVA_ARGS= in settings.cfg with these.