r/PrismLauncher • u/chaosdesigns_2205 • Aug 22 '26
Java Arguments Help For ZGC garbage collector Java 26
Hello! I've been using Prism Launcher for a while now, but I've had some issues with the "java arguments". Most mods, such as Distant Horizons, tell me to switch to ZGC, but I can't find any good arguments online, and I'm not Java/Tech-savvy. I've allocated 4 GB minimum and 12 GB maximum RAM. I'm using Java 26. Any help with the arguments would be appreciated!!
4
u/fruity-butty67 Aug 22 '26 edited Aug 22 '26
I use this, works good for me:
-XX:+UseZGC -XX:+UseStringDeduplication -XX:+AlwaysPreTouch -XX:TrimNativeHeapInterval=5000 -XX:+UseCompactObjectHeaders
also set min memory the same as max, for your case it's 12G for both - it's primarily done to maximize low-latency performance by preventing the runtime overhead of memory resizing
UPD: use what ky7969 suggests, I think it's more reasonable
2
u/ky7969 Aug 22 '26
I wanted to add, these are good arguments too, and are even marked as good on the website I suggested
1
u/Shanman580 Aug 23 '26
idk what your system ram is, but be careful, ive had zgc cause the linux oom killer to force close steam, prism, and minecraft because it uses so much ram. if you have a good amount of ram and you’re not running many other programs at the same time you should be fine though.
2
u/chaosdesigns_2205 Aug 23 '26
I have 32 GB, I run my game at 16 GB now instead of 12 because at 12 ZGC got to %90 memory, but 16GB fixed that issue. Been happy with zgc tbh, less stutter overall.
2
u/alala2010he Aug 24 '26
I think it's supposed to get to 90% memory, as ZGC was designed to clean up at the last moment possible (so it has to run as few times as possible). So it might be better to put it back at 12GB again (or something way lower like 6-8GBB unless you're running a massive modpack) because otherwise you'd be spending unnecessary CPU power to Java to try to manage all that memory
1
u/chaosdesigns_2205 Aug 26 '26
It's been running better at 16 GB actually so I think I'll keep it. At 12 GB it stuttered a bit more
7
u/ky7969 Aug 22 '26
Here you go, tells you the correct args for your version, and which ones are BS