Use Java 17-22. There isn't much difference between versions from 17 to 22. Java 23+ is not recommended because of Generational ZGC, see below.
Java runtimes from Adoptium, Oracle, Azul and so on are basically identical. If you don't know what to pick, I recommend the latest Adoptium Java 21 JDK: https://adoptium.net/
Some notable exceptions:
- Oracle GraalVM features a more aggressive Java compiler. It seems to be worse at the start of the session, but then becomes faster than Adoptium; see the GraalVM section.
GraalVM is a Java VM from Oracle that can improve performance. It tends to have worse performance initially, but starts performing better some time into the session.
You can download GraalVM Java 21 from here (for Windows) or from their website.
Important
These releases are not Java installers, you will need to manually select the Java path in your launcher. After extracting it, navigate to the bin folder in the GraalVM folder and select javaw.exe on Windows or java otherwise.
Tip
If you are using PrismLauncher 9.0+, you can extract it into .../PrismLauncher/java/, which will make GraalVM show up in the Auto-Detect menu. Example folder structure: .../PrismLauncher/java/graalvm-jdk-21+35.1/bin/javaw.exe.
Also, on Prism you should select GraalVM in instance settings, and enable Skip Java compatibility checks.
SeedQueue is a mod that allows you to reset multiple worlds at once. It changes the optimal settings.
Note
These values can depend a lot on your SeedQueue settings, e.g. you would need less RAM per Max Queued Seed if Max World Generation % isn't set to 100%.
For optimal performance, set the maximum memory allocation to between 2000 MB and 2500 MB. If you play on a high render distance (e.g., for All Advancements), consider increasing this to 2800-3000 MB.
For SeedQueue, additionally add 250 MB for each Max Queued Seed (found in Options > Book and Quill > SeedQueue) to this base value.
Example Calculation
If
Max Queued Seedsis set to 20, you should allocate:2000 MB + (250 MB * 20) = 7000 MB
The minimum memory allocation is less critical, but setting it to a higher value can generally improve performance.
ZGC is a garbage collector that has been found to noticeably improve performance with SeedQueue. Add -XX:+UseZGC to your Java arguments to enable it.
Here is a full set of recommended Java arguments:
-XX:+UseZGC -XX:+AlwaysPreTouch -Dgraal.TuneInlinerExploration=1 -XX:NmethodSweepActivity=1
Warning
Java 23+ defaults to Generational ZGC, which was found to reduce performance with SeedQueue, and you can't disable it on Java 24+.
Note
GraalVM did not support ZGC initially, so if Minecraft doesn't launch with the Z garbage collector is not supported by Graal error, you should download and select a newer version. Currently, latest versions of GraalVM 17, 21 and 23 all support ZGC.
After launching Minecraft, you can set Java to run at an "Above Normal" process priority in Windows with the Task Manager (note that you will need to do this every time after launching Minecraft, not just once):
Linux users can use sudo nice -n -10 as a wrapper command, but note that nice levels below 0 (with the "max" being -20) require running Minecraft as sudo, which will likely cause issues. Alternatively, it's better to use the renice command in a terminal after launching Minecraft to avoid this, e.g. run sudo renice --priority -20 -p $(pgrep java).
-
If you're on a laptop, make sure Minecraft is using your discrete GPU! Check the F3 tab, and force Minecraft to use it in the "Windows Graphics Settings", not the AMD/Nvidia control panel (as they don't seem to work anymore). See this page for a full guide.
-
Linux players could check out https://its-saanvi.github.io/linux-mcsr for some additional tips.
-
MacOS players could check out https://www.youtube.com/watch?v=GomIeW5xdBM for some additional tips.
-
Close everything in the background, including Discord, your browser, etc. Minecraft is resource intensive, and does not like other apps generating CPU interrupts or eating disk I/O, RAM and so on.
Contributions to this article were made by maskers, with assistance from jojoe in testing various aspects and helping with writing it.
Original Article Source: https://github.com/brucethemoose/Minecraft-Performance-Flags-Benchmarks
The original article was used as a reference for information and has been heavily modified to suit the needs of MCSR (Minecraft Speedrunning).
Broken link fix: https://gist.github.com/Esensats/a945c253c94c6b0b0dcd069f22c16a2c