- JVM arguments live in your launcher's profile, not in the in-game options.
- They configure the Java runtime that hosts the game, so a typo affects startup, not your world.
- The flag most players want is
-Xmx, which caps how much memory the game can use. - For most setups, 4 to 6 gigabytes is plenty. More can make stutter worse.
You add JVM arguments to Minecraft in your launcher's profile settings. Open the profile you launch with, find the JVM arguments field, and edit the space separated list of flags there. These flags configure the Java virtual machine that hosts the game, not the game itself, so a typo affects startup, not your world.
Where Opal fits
Opal is a Fabric mod, so it shares the same JVM arguments as the game it runs inside. For the version it targets and the exact setup, follow the setup guide.
What a JVM argument is
A JVM argument is a flag you pass to the Java runtime when it starts the game. The launcher builds a long command line every time you press play, and the JVM arguments are the part of that line that tunes the runtime. The most common one sets how much memory the game can use.
These flags are not Minecraft settings. They are read by the JVM before the game even loads, which is why you set them in the launcher and not in the in-game options menu.
Where to put them
Almost every launcher keeps a JVM arguments field inside each profile. The label varies, but the location is consistent.
| Launcher type | Where the field lives |
|---|---|
| The official launcher | Installations, edit a profile, More Options, JVM Arguments |
| A third-party launcher | Profile or instance settings, often under a Java or Advanced tab |
| Command line / scripts | The java command you run, before -jar |
Edit the existing list rather than replacing it. Launchers ship sensible defaults, and wiping them can break startup.
Step by step in the official launcher
Open Installations
Open the launcher and go to Installations.
Edit your profile
Hover the profile you use and click the edit (pencil) icon.
Open More Options
Open More Options. A JVM Arguments box appears.
Edit the flags
Edit the flags in that box. They are separated by spaces.
Save and launch
Save, then launch that profile.
The argument most people want: heap size
The flag most players come for is -Xmx, which caps the maximum heap the JVM may use. -Xmx4G allows up to 4 gigabytes. There is also -Xms, the starting heap.
-Xmx4G -Xms2G
Two rules keep this safe. Do not allocate more than you have free, because the Java process needs headroom and the operating system needs the rest. More is also not always better; very large heaps can make garbage collection pauses worse, not smaller. For most setups, 4 to 6 gigabytes is plenty.
Common flags you will see
-Xmx<size>sets the maximum heap, for example-Xmx4G.-Xms<size>sets the starting heap, for example-Xms2G.-XX:+UseG1GCselects the G1 garbage collector, a common default.-Dproperty=valuesets a system property the game or a mod reads at startup.
You rarely need more than the heap flags. Long copy-pasted argument lists from old guides often hurt more than they help on a modern Java runtime.
When something goes wrong
- Game will not start after editing: a typo in the flags. Restore the default arguments and re-add changes one at a time.
-Xmxis ignored or errors out: wrong unit or syntax. UseGorMwith no space, as in-Xmx4G, not-Xmx 4 GB.- Stutter got worse after raising memory: too large a heap can lengthen garbage-collection pauses. Lower
-Xmxback toward 4 to 6 gigabytes.
FAQ
It sets the maximum heap the Java runtime is allowed to use. -Xmx4G caps the game at 4 gigabytes. It is the flag behind every "allocate more RAM" guide.
For most players 4 to 6 gigabytes is plenty. Allocating far more rarely helps and can make garbage-collection pauses longer, so do not give the JVM all your memory.
Usually not. Mods load inside the same Java process, so they share the heap you already set. A few mods document a specific system property, but the heap flags cover most cases.
No. JVM arguments configure the Java runtime before the game loads and live in the launcher. Game settings live in the in-game options menu.