VibeCordVibeCord
How it worksTemplatesCompareVibeforgeSoonPricingBlogDocs
  1. Home
  2. /
  3. Tools
  4. /
  5. Java Flags Generator

Java Flags Generator

Generate optimized JVM flags based on Aikar's flags for better Minecraft server performance.

Server Configuration

Select the RAM you want to allocate to Minecraft (leave 1-2GB for the OS)

Notes

  • •These flags are based on Aikar's optimized flags for Minecraft servers.

Start Command

java -Xms8G -Xmx8G -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 -XX:+UseStringDeduplication --add-modules=jdk.incubator.vector -jar paper.jar nogui

Copy this command and use it in your start.bat (Windows) or start.sh (Linux) file.

Flag Explanations (22 flags)

Memory

-Xms=8G

Initial heap size - set equal to max for consistency

-Xmx=8G

Maximum heap size - main RAM allocation

-XX:+UseStringDeduplication

Deduplicate identical strings - saves memory

Garbage Collection

-XX:+UseG1GC

Use G1 garbage collector - best for Minecraft

-XX:+ParallelRefProcEnabled

Process references in parallel - reduces GC pauses

-XX:MaxGCPauseMillis=200

Target max GC pause time in milliseconds

-XX:+UnlockExperimentalVMOptions

Enable experimental JVM options

-XX:+DisableExplicitGC

Disable System.gc() calls - prevents plugins from forcing GC

-XX:G1NewSizePercent=30

New generation size - balanced for moderate RAM

-XX:G1MaxNewSizePercent=40

Max new generation size

-XX:G1HeapRegionSize=8M

Heap region size - standard for under 12GB

-XX:G1ReservePercent=20

Reserve memory percentage

-XX:G1HeapWastePercent=5

Acceptable heap waste percentage

-XX:G1MixedGCCountTarget=4

Target mixed GC count

-XX:InitiatingHeapOccupancyPercent=15

Start GC when heap is 15% full - aggressive but reduces lag spikes

-XX:G1MixedGCLiveThresholdPercent=90

Mixed GC live threshold

-XX:G1RSetUpdatingPauseTimePercent=5

Time spent updating remembered sets during pause

-XX:SurvivorRatio=32

Ratio of eden to survivor space

-XX:MaxTenuringThreshold=1

Objects survive 1 minor GC before tenuring - faster promotion

Performance

-XX:+AlwaysPreTouch

Pre-allocate memory pages at startup

-XX:+PerfDisableSharedMem

Disable shared memory for performance counters

--add-modules=jdk.incubator.vector

Enable vector API for SIMD optimizations (Java 16+)

About These Flags

These flags are based on Aikar's optimized flags, which are widely recognized as the best JVM configuration for Minecraft servers. They focus on optimizing the G1 garbage collector to reduce lag spikes and improve overall performance.

Memory Management

Setting -Xms equal to -Xmx prevents heap resizing, which can cause lag spikes. Pre-touching memory ensures it's immediately available.

G1GC Optimization

G1 garbage collector is tuned for Minecraft's memory patterns. Aggressive settings minimize pause times during gameplay.

RAM-Specific Tuning

Servers with 12GB+ RAM get different settings optimized for larger heaps, including larger region sizes and adjusted generation percentages.

Frequently Asked Questions

What are Aikar's flags?

Aikar's flags are a set of optimized JVM parameters created by Aikar (developer of Paper and other Minecraft software) that significantly improve Minecraft server performance by tuning the G1 garbage collector specifically for Minecraft's memory usage patterns.

How much RAM should I allocate?

For vanilla servers, 4-6GB is usually sufficient. For modded servers (Forge/Fabric), 6-12GB depending on mod count. Paper/Spigot servers benefit from 4-8GB for most use cases. Always leave 1-2GB for the operating system.

Which Java version should I use?

Java 17 or 21 (LTS versions) are recommended for Minecraft 1.17+. Older versions (1.16 and below) require Java 8 or 11. Always use the latest LTS release for best performance and security.

Why set -Xms equal to -Xmx?

Setting minimum and maximum heap size to the same value prevents the JVM from dynamically resizing the heap during runtime, which can cause noticeable lag spikes when the server needs more memory.

Do these flags work with all server types?

Yes, these flags work with Paper, Spigot, Purpur, Fabric, Forge, and vanilla servers. The core optimizations apply to all Minecraft server implementations since they target the JVM, not the server software itself.

Skip the complexity - VibeForge handles all optimization

Let VibeForge configure and optimize your server automatically

Get Started
View all Minecraft tools

Have feedback or questions?

Join our Discord community to share ideas, get help, and connect with other creators.

Join Discord
View all tools
Join our community
DocsTemplatesCompareVibeforgeBlogChangelogStatusPricingTrust & SecurityTermsPrivacyDiscord supportFree Tools

VibeCord (Discord bots) is live. Vibeforge (Minecraft servers) launches Early 2026.

Built for Discord communities and gaming servers. Please follow platform rules and guidelines.

VibeCord is an independent tool and is not affiliated with, endorsed by, or sponsored by Discord Inc. or Mojang Studios.

VibeCord© 2026 VibeCord Technologies. All rights reserved.