Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First of all, a little technical background. Minecraft is written in Java. Java is capable of using multiple CPU cores. But applications written in Java must usually be multi-threaded in order to take advantage of multi-core. Even then, just having a multi-threaded Java application doesn't necessarily mean the application will be faster on multi-core. Likewise, some tasks cannot be split into multiple threads.
- The Minecraft client has an appropriate level multi-threading: almost none. Any attempt to split the tasks into more threads will probably not improve performance.
- So we must use other approaches to try to take advantage of multi-core.
- One way is to tell the OS to route all Minecraft specific tasks to an unused CPU. This is done by setting CPU affinity of one CPU to Minecraft, and taking away affinity of everything else from that dedicated CPU. With certain configurations, this can give Minecraft quite a boost. If you would like to learn about this, Google: minecraft cpu affinity
- But there's a different way to get better performance out of Minecraft. I would not recommend this for the technologically challenged user, but it's not too complicated.
- Basically, Java 7 has a new Garbage Collector called G1GC. There are actually several garbage collectors, but G1GC is the newest. To enable it, you need to use the following Java parameter:
- -XX:+UseG1GC
- If you're on Java 6 (Update 18 or later), you can enable G1GC using the following two Java parameters:
- -XX:+UnlockExperimentalVMOptions
- -XX:+UseG1GC
- G1GC is a parallel garbage collector. It's not the only parallel garbage collector Java has, but it's the newest and has a lot of great engineering under the hood. One of the biggest features of G1GC is that you'll see far fewer "stop the world" situations, where Minecraft just stops completely for several seconds, not responding to any command or mouse movement.
- By the way, it's better to use G1GC instead of setting CPU affinity. Doing both will not be as effective.
- To set this parameter on Windows, click Start, Run:
- java -Xmx1G -Xms1G -XX:+UseG1GC -jar "C:\path\to\Minecraft.exe"
- Or on Java 6 (Update 18 or later)
- java -Xmx1G -Xms1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -jar "C:\path\to\Minecraft.exe"
- To verify G1GC is active in Minecrat, use the Snooper Settings ... and look for a jvm_arg with -XX:+UseG1GC.
Advertisement
Add Comment
Please, Sign In to add comment