r/PrismLauncher • • 1d ago

General question about Java arguments

To get straight to the point, I don't really understand much about this, so I searched on Google, but I always run into a different answer. Before, I used these arguments:

-Djava.net.preferIPv4Stack=true -XX:+AlwaysPreTouch -XX:+UseShenandoahGC

but I switched to these:

-Djava.net.preferIPv4Stack=true -XX:+AlwaysPreTouch -XX:+UseZGC -XX:+ZGenerational

precisely because Google recommends a different one every time. So I'd like some guidance from the Prism Launcher community: which arguments should/do I need to use? Are they generic, or do I need different arguments for each modpack, version, and mod loader? What is the most reliable source for me to get argument sets to better optimize my game and make the most out of my build?

I appreciate any help and clarification, I'm really quite a beginner at this.

3 Upvotes

3 comments sorted by

2

u/Available-Squash1021 1d ago

You don't need a different argument list for every pack, version, or loader. Prism's Java Settings page (https://prismlauncher.org/wiki/help-pages/java-settings/) treats JVM arguments as optional their screenshots leave that box empty and focuses on using the right Java version (Autodetect Java version and Auto-download Mojang Java are both marked recommended) and on memory. They also note that more RAM does not automatically mean better performance, and that 4 GB is enough in most cases except big modpacks.

The two lists you tried are almost the same, except you swapped the garbage collector from Shenandoah (-XX:+UseShenandoahGC) to ZGC (-XX:+UseZGC -XX:+ZGenerational). Those are alternative collectors, so you only want one of them, which you already have. If the game is already running smoothly, you don't need to keep chasing new flag lists from Google.

Some pack wikis publish arguments for that specific pack (the ATM guide already linked above is an example). Those can be useful when you're actually playing that pack, but they aren't a universal default. A lot of Google results are also aimed at Minecraft servers rather than the client, so they're a poor fit for Prism.

A solid baseline is: set memory in the instance's Java settings, leave Autodetect / Mojang Java on, and only add extra arguments if you have a specific hitch you're trying to fix. Prism's Test button on that same settings page will check the Java runtime, memory, and JVM arguments without launching the game.

1

u/AdLow1228 1d ago edited 1d ago

It is dependant on

  • Minecraft version
  • Java version
  • How much RAM you have to allocate
  • I think sometimes your CPU? But idk
  • Any lag issues? If not then you don't really need to bother

For what your best java arguments will be

But there are 2 sets of generic-ish ones for older vs newer garbage collection settings then if large pack add a lil extra

That I use anyways idk what they are tho lol it's on my PC somewhere (on phone rn)

But personally if you use AI you can tell it those details and ask for JVM arguments, some modpacks such as ATM packs supply suggested arguments aswell

Ahh which I believe I mainly use the ATM pack ones maybe slightly modified for myself tho

https://allthemods.github.io/alltheguides/help/java/

1

u/Duox29 1d ago

google guides are almost based on akira's flag. maybe you can try meowice's flag