author

Administrator

Article

Optimizing Minecraft Servers: A Guide to Startup JVM Flags for Bukkit, Fabric, and Forge

Running a Minecraft server isn’t just about powerful hardware. It’s about optimizing the Java Virtual Machine (JVM) for peak performance and a seamless gameplay experience. Startup JVM flags are a set of parameters that control how Java allocates memory, manages garbage collection, and handles other critical tasks. In this article, we'll explore the best JVM flags for Bukkit, Fabric, and Forge servers, helping you achieve smoother gameplay and better resource utilization.

At purehosted, we take the hassle out of server management, handling memory settings behind the scenes so you can focus on what matters—playing and hosting. Our platform ensures that if you pay for 8GB of RAM, you get the full 8GB for your server. We handle the overhead required to run the virtual machine, so there are no hidden costs or surprises.

What Are JVM Flags?

JVM flags are command-line arguments passed to the Java runtime environment when starting a server. They allow server administrators to customize garbage collection behavior and other performance-related settings. Properly configured flags can reduce lag, improve tick rates, and ensure stability, especially for modded servers.

While most hosting providers lock down JVM flags, purehosted gives you the freedom to tailor these settings to your server’s unique needs—with expert guidance every step of the way.

General Recommendations for All Servers

  • Use the latest Java version: For Minecraft 1.18 and above, Java 17 is the minimum requirement. Newer versions often include performance improvements.
  • Skip the hassle of manual memory settings: purehosted takes care of parameters like -Xms and -Xmx for you, while also factoring in memory overhead, guaranteeing optimal performance out of the box.

Aikar's Flags: A Strong Starting Point

-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -Dpaper.disableChannelLimit=true -Dpaper.maxCustomChannelName=128

Bukkit Servers

Bukkit servers (including Spigot, Paper, Purpur, and other forks) are performance-focused and lightweight. Aikar’s flags are a tried-and-true solution for optimizing Bukkit servers, delivering smooth gameplay and stability.

Fabric Servers

Fabric servers are known for their lightweight and modular modding toolchain. These additional tweaks can further optimize performance:

  • Add -XX:+UseStringDeduplication to reduce memory usage by eliminating duplicate strings, which is particularly useful for mods that generate many string-heavy objects.
  • For servers with high player counts, set -XX:G1HeapRegionSize=16M for better garbage collection performance.

Forge Servers

Forge servers often run large modpacks, requiring more memory and careful tuning. Along with Aikar's flags, consider:

  • Setting -XX:G1HeapRegionSize=16M ensures efficient memory management for large modpacks.


Was this article helpful?

Discussion (0)

Info

Once payment is completed, the amount you have selected will be credited to your account balance, enabling you to renew your services or place new orders.

How much do you want to add?