Minecraft - JVM Tuning

GC Performance Tuning - Focusing on Java Runtime Environments 8 and 13

Experimental Linux Runtime Arguments (JDK 11+)

What is GC?

Garbage Collecting (GC) is a super important process for languages like Java and C#. I spend 90% of my time in C# and 10% in Golang (also has a GC). Despite that, I know only the very basics of GC... which is the point! It is a system that cleans up the resources I am no longer using or referencing. It works so well I haven't been forced to really tinker with it - ever!

Now Minecraft is a bit of a different beast. My observation is, it's the most successful game of its type, one of the most succesful games of all time... and written in Java. It's like finding out Rembrandt used a toothbrush (he didn't). His paintings are so revered but then you get a bonus WOW factor of his technique with a soft bristled Oral-B (still fibbing - please don't edit Wikipedia).

ZGC - Experimental Java GC

ZGC has been available on Linux since about JDK11 now... just not on Windows. Womp womp. ZGC is a high performing, scalable, low latency garbage collector and initially designed to work with 1TB+ heapsizes (but it works good with smaller ones too). It does have some custom options but out of the box it is multi-threaded and tweaks itself to better performing on your specific system. Which means that you don't need to go setting a 100 perf options/strategies for this little guy.

"C:\Program Files\Java\jdk-13.0.1\bin\java.exe" -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms16G -Xmx16G -jar server.jar nogui


Source: OpenJDK ZGC Page Garbage Tuning (JDK13)

Work in progress.