Skip to content

How to Improve Performance!

sainagh edited this page Aug 13, 2024 · 47 revisions

JVM Arguments [EASY]

JVM (Java Virtual Machine) arguments are 'Java settings' that can be added to make Meatballcraft run smoother!

For CurseForge

NOTE: Curseforge applies JVM arguments to all modpacks, in some cases it can make other packs run worse, or not run at all.

  1. Go to 'Settings' (bottom left of CurseForge menu)
  2. 'Game Specific' > 'Minecraft'
  3. Scroll all the way to the bottom
  4. Set 'Allocated Memory' between 8 GB and 10 GB
  5. Copy and paste the arguments from this page (Option 1 or Option 2) into the 'Additional Arguments' field

For Prism

  1. Go to 'Settings'
  2. Go to 'Java'
  3. Set 'Maximum Memory Allocation' between 8 GB and 10 GB
  4. Copy and paste the arguments from this page (Option 1 or Option 2) into the 'JVM Arguments' field
  5. 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 22 [a bit harder] [only from beta-0.15.2 onwards]

Minecraft 1.12 runs on Java 8, which is old and slow. Upgrading to Java 22 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, pelase follow the steps here.

For a more automated setup on Linux, you can use the Python setup here!

KNOWN BUG: items may shift around your inventory. We are working on it!

Thanks to thermonuclear_minecraft_engineer for making this possible and to puddinpopper for testing out and fine-tuning these instructions!

  1. Install Prism Launcher [NOTE: make sure you are using Java x64, Java x32 will error out as a JVM issue with Prism]
  2. Download and install Meatballcraft using Prism
  3. Launch the pack till main menu [using java 8 still], and close it
  4. Install Java 22 from this link [make sure you pick the right operating system] [if you know what you are doing, JRE is harder to install but it performs better sometimes]
  5. Download this build of Cleanroom MMC
  6. In Prism, 'Add Instance' ➜ 'Import' ➜ Cleanroom_MMC.zip
  7. Edit the instance ➜ 'Settings' ➜ 'Java Installation' ➜ set to your Java 22 path [Example directory C:/Program Files/Zulu/zulu-22/bin/java.exe].
  8. Allocate the same amount of ram for both memory settings (recommended 9000 Mb)
  9. Set Java Arguments to -XX:+UseZGC -XX:+ZGenerational
  10. Launch CleanroomMMC* instance once, and close it
  11. 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]
  12. config/forge_early.cfg ➜ set INPUT_SCROLL_SPEED to 120
  13. Disable !mixinbooter, and configanytime mods if present (remove them from mods folder)
  14. [Optional] Change JVM arguments to the ones at the bottom of the page
  15. [Optional] Change your video settings after first launch: Fancy graphics. 4 mipmap. no clouds
  16. 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 22 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 22

Java 22 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 22 client anyway!

These instructions are still being tested, please provide feedback for unclear things if you try them out!

  1. Install a java 22 client, you will need some files from there
  2. Download the server files from CurseForge and extract the .zip in the desired folder
  3. Delete the following files and folders:
  • libraries folder
  • forge-1.12.2-14.23.5.2860.jar file
  • minecraft_server.1.12.2.jar
  1. Delete !mixinbooter, MixinCompat, and configanytime mods if present
  2. Download the Cleanroom MMC installer for server
  3. Run the .jar program, select install server, select server files directory
  4. Paste forge_early.cfg from your client to the server config folder
  5. Open settings.cfg and select the right path for java 22
  6. Start the server using CleanroomStart.bat on windows or execute the following start on linux

This includes an example java 22 directory, change it to the one you use!

~/zulu22.30.13-ca-jdk22.0.1-linux_x64/bin/java -server -Xms2128M -Xmx6120M -Xss4M -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:+UseCriticalJavaThreadPriority -XX:ThreadPriorityPolicy=1 -XX:+UseFastUnorderedTimeStamps -XX:+UseZGC -XX:AllocatePrefetchStyle=1 -XX:+ZGenerational -jar cleanroom-0.2.1-alpha.jar nogui