Major Incident: We are currently experiencing service disruptions. Our team is working to resolve this issue.

JVM Arguments Generator

Generate optimized Java Virtual Machine arguments for Minecraft servers. Choose from proven flag presets like Aikar, MeowIce, or GraalVM optimizations.

Configuration

Basic Configuration

Amount of RAM to allocate to your server

Choose a flag configuration preset

Your server's Java version

Your server software type

Optimize for specific use case

Custom Flags (Optional)

Add custom flags separated by spaces (e.g., -Dfml.readTimeout=180)

Usage Information

How to Use:

  1. Copy the generated flags from the preview panel on the right
  2. Add them to your server's start script or launcher
  3. Place them BEFORE the -jar argument
  4. Example: java [FLAGS] -jar server.jar nogui

Note: Aikar and MeowIce flags are the most tested and recommended for Minecraft servers.

Preview
-Xms4G -Xmx4G -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 -XX:+UseNUMA -Dpaper.playerconnection.keepalive=120

What are JVM Arguments?

JVM (Java Virtual Machine) arguments are startup flags that control how Java runs your Minecraft server. These flags configure memory allocation, garbage collection, and runtime optimizations that can dramatically impact your server's performance.

Properly configured JVM arguments can:

  • Reduce lag spikes from garbage collection
  • Improve tick rate consistency
  • Lower memory usage overhead
  • Increase overall server performance
  • Prevent crashes from memory issues

Why JVM Arguments Matter for Minecraft

Minecraft servers are notoriously demanding on the JVM due to their unique workload patterns:

Minecraft's Memory Characteristics

Short-lived Objects: Most game objects (entities, block updates) are created and destroyed rapidly, making garbage collection frequency critical.

Tick-Based Execution: Minecraft runs on a strict 20 TPS (ticks per second) cycle. Any garbage collection pause over 50ms causes noticeable lag.

Large Heap Sizes: Servers with many players and chunks loaded require 4GB-16GB+ of RAM, making garbage collector choice critical.

Popular Flag Presets

Aikar's Flags (Most Recommended)

Aikar's flags are the most battle-tested JVM arguments for Minecraft, used by thousands of servers including large networks.

Key Features:

  • Optimized for G1GC (Garbage First Garbage Collector)
  • Tuned specifically for Minecraft's memory patterns
  • Proven to reduce lag spikes by 70%+ on average
  • Works well with 2GB-32GB RAM allocations

Best For:

  • Paper, Purpur, Spigot servers
  • Vanilla servers with 4GB+ RAM
  • SMP and survival servers
  • Most production environments

MeowIce Flags (Modern Java 17+)

MeowIce flags are a more recent optimization targeting Java 17 and newer versions with updated GC tuning parameters.

Key Features:

  • Leverages Java 17+ garbage collection improvements
  • More aggressive young generation sizing
  • Lower pause time targets
  • Better performance on modern CPUs

Best For:

  • Java 21 servers (recommended)
  • Purpur and Paper servers
  • PvP servers requiring low latency
  • Servers with consistent player counts

GraalVM Flags

Optimized for the GraalVM JIT compiler, offering potential performance gains through advanced compilation.

Key Features:

  • Enhanced JIT compilation
  • Better string deduplication
  • Compressed object pointers
  • Potential 10-15% performance boost

Best For:

  • GraalVM distributions only
  • High-performance requirements
  • Advanced users willing to test

RAM Allocation Guidelines

Choosing the right RAM allocation is critical for performance:

Small Servers (5-20 Players)

Recommended RAM: 3-4GB Flag Preset: Aikar Flags - Low RAM Notes: Perfect for friend servers and small SMPs

Medium Servers (20-50 Players)

Recommended RAM: 6-8GB Flag Preset: Aikar Flags - Medium RAM or MeowIce Flags Notes: Suitable for public servers with moderate player counts

Large Servers (50-100 Players)

Recommended RAM: 10-16GB Flag Preset: Aikar Flags - High RAM or MeowIce Flags Notes: Consider dedicated hardware and chunk pregeneration

Network/Proxy Servers (100+ Players)

Recommended RAM: 16GB+ per backend server Flag Preset: MeowIce Flags with low-latency profile Notes: Distribute load across multiple backend servers

Java Version Considerations

Java 17 (LTS)

  • Stable and well-tested
  • Full Minecraft 1.18+ support
  • Good compatibility with mods
  • Recommended for Forge servers

Java 21 (LTS - Recommended)

  • Latest LTS version
  • Best garbage collection performance
  • Required for Minecraft 1.20.5+
  • Recommended for Paper/Purpur

Java 23

  • Bleeding edge features
  • Experimental improvements
  • May have mod compatibility issues
  • Use only if you need specific features

Garbage Collection Algorithms

Understanding garbage collectors helps you choose the right flags:

G1GC (Default - Recommended)

Pros:

  • Well-balanced for Minecraft workloads
  • Predictable pause times
  • Excellent tuning documentation
  • Works well with 4GB-64GB heaps

Cons:

  • Can have occasional long pauses with huge heaps (64GB+)

ZGC (Low Latency)

Pros:

  • Ultra-low pause times (sub-millisecond)
  • Scales to multi-TB heaps
  • Never stops-the-world

Cons:

  • Requires Java 21+
  • Higher CPU overhead
  • Experimental for Minecraft
  • Needs 16GB+ RAM to show benefits

ShenandoahGC (Low Pause)

Pros:

  • Very low pause times
  • Good for PvP servers
  • Less CPU overhead than ZGC

Cons:

  • Requires -XX:+UseShenandoahGC flag
  • Not available in all JDK builds
  • Less testing with Minecraft

ParallelGC (High Throughput)

Pros:

  • Highest throughput
  • Best for batch processing

Cons:

  • Long pause times (100ms+)
  • NOT recommended for Minecraft

Performance Profiles

Balanced (Recommended)

Best all-around performance for most servers. Uses proven flag combinations without extreme tuning.

Low Latency (PvP Servers)

Minimizes garbage collection pause times at the cost of slightly lower throughput. Ideal for competitive PvP where every millisecond counts.

High Throughput (Large Servers)

Maximizes overall performance for servers with high player counts and chunk loading. May have slightly longer GC pauses but better overall TPS.

Minimal (Vanilla Servers)

Basic flags for vanilla servers that don't need heavy optimization. Simple and safe.

Common Mistakes to Avoid

Over-Allocating RAM

Problem: Allocating 32GB when you only need 8GB Impact: Longer garbage collection pauses, worse performance Solution: Start small and increase only if needed

Mixing Flag Presets

Problem: Combining Aikar flags with other presets Impact: Conflicting GC settings, unstable performance Solution: Stick to one preset, don't mix and match

Using Old Java Versions

Problem: Running Minecraft 1.20 on Java 8 Impact: Missing critical performance improvements Solution: Use Java 21 for modern Minecraft versions

Ignoring Server Software

Problem: Using vanilla flags on heavily modded Forge Impact: Insufficient timeout settings, crashes Solution: Adjust flags based on server software (add Forge-specific flags)

Not Testing Changes

Problem: Deploying new flags without testing Impact: Unexpected crashes or performance degradation Solution: Test on a copy of your server first

Modded Server Considerations

Forge Servers

Forge servers need additional considerations:

# Add Forge-specific flags
-Dfml.readTimeout=180
-Dfml.queryResult=confirm

Recommended RAM: 8GB minimum for large modpacks Java Version: Java 17 for compatibility Preset: Aikar Flags with higher RAM allocation

Fabric Servers

Fabric is more lightweight:

Recommended RAM: Same as vanilla + 1-2GB Java Version: Java 21 for best performance Preset: MeowIce Flags work excellently

NeoForge Servers

Similar requirements to Forge:

Recommended RAM: 8GB+ for modpacks Java Version: Java 21 (NeoForge requires it) Preset: Aikar or MeowIce Flags

Server Software Optimizations

Paper/Purpur Servers

Paper and Purpur include built-in optimizations that work well with aggressive JVM tuning:

-Dpaper.playerconnection.keepalive=120

Vanilla Servers

Vanilla benefits from conservative flags since it has no server-side optimizations.

How to Apply JVM Arguments

Step 1: Copy Generated Flags

Use this tool to generate your optimized flags, then copy them from the preview panel.

Step 2: Add to Start Script

Linux/macOS (start.sh):

#!/bin/bash
java [YOUR FLAGS HERE] -jar server.jar nogui

Windows (start.bat):

@echo off
java [YOUR FLAGS HERE] -jar server.jar nogui
pause

Step 3: Verify Placement

Flags must come BEFORE the -jar argument:

Step 4: Test and Monitor

Start your server and monitor performance:

  • Check TPS with /tps or Spark
  • Watch for GC pauses in console
  • Monitor RAM usage
  • Check for crashes or errors

Monitoring and Tuning

Tools for Performance Monitoring

Spark Plugin: Best for in-game profiling

JVM Monitoring:

# Add to flags for detailed GC logging
-Xlog:gc*:file=gc.log:time,level,tags

Timings/Spark Reports: Share performance data with others for optimization help.

Signs You Need to Adjust Flags

Frequent Lag Spikes: Try MeowIce flags or lower GC pause time target Constant High Memory: Reduce RAM allocation or add more heap headroom OutOfMemory Errors: Increase RAM allocation (or reduce view distance) Poor TPS Under Load: Try high-throughput performance profile

Advanced Custom Flags

For advanced users, you can add custom flags to further tune performance:

Large Pages (Linux)

-XX:+UseLargePages

Requires system configuration but can improve performance by 5-10%.

Aggressive Optimizations

-XX:+AggressiveOpts

Enables experimental optimizations (use with caution).

Disable Explicit GC

-XX:+DisableExplicitGC

Already included in Aikar/MeowIce flags. Prevents plugins from forcing GC.

Troubleshooting

Server Won't Start

Error: Unrecognized option

  • Check Java version compatibility
  • Some flags require Java 17+
  • Remove unsupported flags

Error: Could not reserve enough space

  • Reduce RAM allocation
  • Check system available memory
  • Use 64-bit Java

Performance Not Improving

Still Getting Lag Spikes:

  1. Verify flags are applied correctly (check startup log)
  2. Profile with Spark to find non-GC lag sources
  3. Consider reducing view/simulation distance
  4. Check for poorly optimized plugins

High Memory Usage:

  1. May be normal - Java uses what you give it
  2. Check for memory leaks with heap dumps
  3. Reduce pregenerated chunks
  4. Lower entity limits

FAQ

Related Tools

Optimize your Minecraft server further with these tools:

External Resources