Skip to main content

Tuning the Engine: Startup Flags


Minecraft runs within the Java Virtual Machine (JVM). By providing specific instructions (flags) during startup, you can control how Java handles memory allocation and “Garbage Collection,” drastically reducing micro-stutters and lag spikes.
Reading TimeDifficultyLast Updated
5 minutesIntermediateJanuary 2026

Aikar’s Flags: The Gold Standard

Aikar’s flags are a set of JVM arguments developed over years of community testing. They prioritize frequent, tiny memory cleanups over infrequent, massive ones, which prevents the server from “freezing” every few minutes.

The Flag String

If your plan allows for custom startup flags, this is the recommended string for modern Minecraft (1.18+):
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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
}

Memory Allocation Best Practices

Xms vs Xmx

Always set your Minimum Memory (Xms) equal to your Maximum Memory (Xmx).
  • Why? If they differ, the server will constantly try to resize its memory heap, consuming CPU cycles and causing lag while it negotiates with the operating system.

Leave Overhead for the OS

If your plan has 12GB of RAM, do not allocate -Xmx12G.
  • Safe Limit: Set your Xmx to approximately 1GB - 1.5GB less than your total plan limit (e.g., -Xmx10500M). This leaves room for the Linux OS and the control panel’s background processes.

FREAKHOSTING Optimization

Our Premium and Extreme plans include these optimizations automatically at the panel level. You typically do not need to manually enter flags unless you are running a highly specialized modpack.

Support Channels

If you need assistance or have any questions, please contact our support team:

First Month Discount

Use code KB20 at checkout to get 20% off your first month of hosting!

Last Updated: January 2026 | Java: Optimized for Minecraft.