skywardmc / adrenaline

Leading, lightweight, and unbiased performance modpack with no QoL features
https://modrinth.com/project/Adrenaline/
MIT License
59 stars 9 forks source link

Change recommended JVM flags for OpenJ9 on wiki #28

Open Phoenix-Starlight opened 1 year ago

Phoenix-Starlight commented 1 year ago

What's wrong with the flags recommended

  1. The GC pause time target flag won't do anything, because that isn't what OpenJ9 accepts on the default garbage collector (also 6ms is ridiculously unreasonable)
  2. The G1 flags are useless, because there is no G1GC on OpenJ9
  3. Explicitly setting generation sizes is not necessarily wrong but can easily shoot you in the foot
  4. Setting GC threads is invalid in the default GC of OpenJ9
  5. Setting a maximum on the tenuring threshold is not a good choice (java dynamically adjusts but considers the maximum... which way smaller than the hard maximum)
  6. The default GC for OpenJ9 is gencon which is similar to ParallelGC. Not great. In a nutshell its stop-the-world but use multiple threads to make it faster on its stop-the-world collection. OpenJ9 balanced which is supposed to be similar to G1GC literally kneecaps Minecraft. The rest are undesirable policies. The best policy (or only sane one) is gencon but with -Xgc:concurrentScavenge, which unfortunately may not play nicely with spark's gcmonitor command. (It's hit or miss as to whether it's going to break)

What flags should be used then?

-Xgc:concurrentScavenge -XX:+DisableExplicitGC -XX:+UseCompressedOops with possibly -Xaggressive or -Xgc:dynamicBreadthFirstScanOrdering. If you as the user add in extra flags there's a 90% chance that they won't work. Do not add in more. Do not play with -Xjit. You can check Eclipse documentation which tracks the newest release of OpenJ9. (And ask/test it)

Unfortunately one cannot PR to the wiki nor make changes (reasonable).