Back to Tools

Minecraft Server Startup Flags Generator

Generate optimized JVM flags for your Minecraft server with Aikar's flags, automatic restarts, and more.

This tool is powered by flags.sh, an open-source project for generating Minecraft server startup scripts. Configure your server settings below and copy the generated script.

What are Aikar's Flags?

Aikar's flags are JVM optimizations specifically tuned for Minecraft servers. They improve garbage collection and reduce lag spikes.

Why Use This Tool?

Manually configuring JVM flags is error-prone. This tool generates the correct flags based on your RAM and server software.

Pterodactyl Support

The tool accounts for Pterodactyl overhead, ensuring your server doesn't exceed container memory limits.

Need a Server to Run These Flags?

Get instant Minecraft server hosting with our optimized hardware. All our plans support custom startup flags and run on NVMe SSDs.

Understanding Minecraft Server JVM Flags

Java Virtual Machine (JVM) flags are command-line arguments that control how Java runs your Minecraft server. The right flags can significantly improve server performance, reduce lag spikes, and optimize memory usage. Our free Minecraft server flags generator helps you create the perfect startup script for your server software and hardware configuration.

Why Server Flags Matter

Without proper JVM flags, your Minecraft server may experience garbage collection pauses that cause noticeable lag spikes for players. The default Java settings aren't optimized for game servers, which need consistent performance rather than maximum throughput.

Aikar's flags have become the industry standard for Minecraft server optimization. Developed by one of the Paper/Spigot developers, these flags configure the G1 garbage collector to minimize pause times while efficiently managing memory in the unique allocation patterns that Minecraft creates.

Key Optimizations Included

  • G1 Garbage Collector - Optimized for low-latency applications with predictable pause times
  • Memory Region Sizing - Tuned region sizes based on your allocated RAM for efficient allocation
  • Heap Optimization - Pre-allocated heap to avoid runtime resizing and fragmentation
  • GC Pause Targets - Configured to keep garbage collection pauses under 200ms

How to Use the Flags Generator

  1. Select your server software (Paper, Spigot, Fabric, Forge, Vanilla, etc.)
  2. Enter the amount of RAM you want to allocate to your server
  3. Choose your operating system (Windows, Linux, or macOS)
  4. Enable optional features like automatic restarts or GUI mode
  5. If using Pterodactyl panel, enable the Pterodactyl option for adjusted memory overhead
  6. Copy the generated script and save it as your startup file

Recommended RAM Allocations

2-4 GB

Vanilla server, 1-10 players

4-6 GB

Paper/Spigot with plugins, 10-30 players

6-10 GB

Light modpacks or larger plugin servers

10+ GB

Heavy modpacks like ATM9 or Create

Common JVM Flags Explained

-Xms / -Xmx

Sets the initial and maximum heap size. For Minecraft servers, these should be set to the same value to prevent runtime heap resizing, which can cause lag spikes.

-XX:+UseG1GC

Enables the G1 (Garbage First) garbage collector, which is designed for applications requiring low pause times. This is essential for game servers.

-XX:MaxGCPauseMillis=200

Sets a target for maximum garbage collection pause time. The JVM will attempt to keep GC pauses under this threshold.

-XX:+ParallelRefProcEnabled

Enables parallel reference processing during garbage collection, reducing pause times further on multi-core systems.

Server Software Compatibility

This flags generator supports all major Minecraft server software:

Paper

Performance-focused fork of Spigot

Spigot

Plugin-compatible server

Purpur

Paper fork with extra features

Fabric

Lightweight mod loader

Forge

Popular modding platform

NeoForge

Modern Forge alternative

Important Notes

  • • Never allocate more than 10-12GB to a single Minecraft server, as this can cause longer GC pauses
  • • Leave at least 1-2GB of system RAM free for the operating system and other processes
  • • For modded servers, more RAM isn't always better - proper flag configuration matters more
  • • If using a hosting panel like Pterodactyl, enable the overhead adjustment option

Frequently Asked Questions

What are Aikar's flags?

Aikar's flags are a set of JVM arguments developed by Aikar (a Paper developer) specifically optimized for Minecraft servers. They configure the G1 garbage collector to minimize lag spikes and optimize memory management for the unique patterns Minecraft creates. They're considered the gold standard for Minecraft server optimization.

How much RAM should I allocate to my Minecraft server?

For vanilla Minecraft with a few players, 2-4GB is sufficient. Plugin servers (Paper/Spigot) typically need 4-6GB. Light modpacks require 6-8GB, while heavy modpacks like All The Mods or Create: Above and Beyond may need 8-12GB. Never exceed 12GB as it can cause longer garbage collection pauses.

Why should I use G1GC instead of ZGC or Shenandoah?

While ZGC and Shenandoah offer lower pause times, G1GC is better suited for Minecraft's allocation patterns with the proper tuning from Aikar's flags. G1GC with these optimizations provides the best balance of throughput and low latency for most Minecraft servers.

Do these flags work with modded Minecraft?

Yes! These flags work with all Minecraft server types including Forge, Fabric, NeoForge, and Quilt modded servers. The garbage collection optimizations benefit modded servers especially, as mods often create more objects that need to be garbage collected.

What's the difference between -Xms and -Xmx?

-Xms sets the initial heap size and -Xmx sets the maximum heap size. For Minecraft servers, you should set both to the same value. This prevents the JVM from needing to resize the heap during runtime, which can cause lag spikes as memory is allocated.

How do I use the generated startup script?

Copy the generated script and save it as a file. On Windows, save it as "start.bat". On Linux/macOS, save it as "start.sh" and make it executable with "chmod +x start.sh". Place the script in your server directory alongside your server jar file, then run it to start your server.