Skip to main content
Back to Category

Minecraft Server Optimization: TPS and Memory Management

Paper/Purpur server optimization, JVM flags, chunk loading settings, and plugin optimization guide.

Read time: 16 dk Game Server Setup
minecraftpaperpurpurjvmtpsoptimizationchunk loadingplugin

Table of Contents

Introduction

Minecraft server performance is measured by TPS (Ticks Per Second). The ideal TPS value is 20, and dropping below this causes lag, block delay, and degraded player experience. This guide covers maximizing your Minecraft server performance with Paper/Purpur server software, JVM optimization, chunk loading settings, and plugin optimization.

Server Software Selection

Paper vs Purpur vs Spigot

FeatureSpigotPaperPurpur
PerformanceMediumHighVery High
Async Chunk LoadingNoYesYes
Anti-XrayNoYesYes
Extra ConfigurationLowMediumHigh
Plugin CompatibilityHighHighHigh

Paper or Purpur is recommended for performance-focused servers. Purpur is a fork of Paper with additional optimization options.

Paper Installation

hljs bash
mkdir ~/minecraft && cd ~/minecraft
wget -O paper.jar https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/latest/downloads/paper-1.21.4-latest.jar

JVM Flags Optimization

hljs bash
nano ~/minecraft/start.sh
hljs bash
#!/bin/bash
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 \
  -Dusing.aikars.flags=https://mcflags.emc.gs \
  -Daikars.new.flags=true \
  -jar paper.jar --nogui
hljs bash
chmod +x ~/minecraft/start.sh

JVM Flag Explanations

FlagDescription
-Xms / -XmxMin/Max heap size (same value recommended)
-XX:+UseG1GCUse G1 Garbage Collector
-XX:MaxGCPauseMillis=200Limit GC pause to 200ms
-XX:+AlwaysPreTouchPre-allocate memory
-XX:G1NewSizePercent=30Young generation size
-XX:G1HeapRegionSize=8MHeap region size

Keep -Xms and -Xmx the same. Different values negatively affect GC performance. Allocate 70-80% of total server RAM.

Chunk Loading Optimization

paper-world-defaults.yml

hljs yaml
chunks:
  auto-save-interval: 6000
  delay-chunk-unloads-by: 10s
  max-auto-save-chunks-per-tick: 6
  prevent-moving-into-unloaded-chunks: true

spigot.yml

hljs yaml
world-settings:
  default:
    view-distance: 6
    simulation-distance: 4
    mob-spawn-range: 4
    entity-activation-range:
      animals: 16
      monsters: 24
      raiders: 48
      misc: 8
    tick-inactive-villagers: false
    nerf-spawner-mobs: true
    merge-radius:
      item: 3.5
      exp: 4.0

bukkit.yml

hljs yaml
spawn-limits:
  monsters: 30
  animals: 8
  water-animals: 3
  ambient: 1
ticks-per:
  animal-spawns: 400
  monster-spawns: 4
  autosave: 6000

Plugin Optimization

Performance-Affecting Plugins

hljs bash
# Generate timings report (Paper)
/timings on
# Wait 10 minutes
/timings paste
PluginFunction
SparkPerformance profiling
FarmControlFarm entity limiting
ClearLagEntity cleanup
ViewDistanceTweaksDynamic view distance

Reducing Plugin Count

  • Remove unused plugins
  • Consolidate plugins with similar functions
  • Measure each plugin's TPS impact with Spark
  • Replace heavy plugins with alternatives

TPS Monitoring

hljs bash
# In-game TPS check
/tps

# Detailed profiling with Spark
/spark profiler start
# Wait 5 minutes
/spark profiler stop
/spark profiler

TPS Assessment

TPSStatus
20.0Perfect
18-19.9Good
15-17.9Acceptable
10-14.9Poor
<10Critical

Memory Management

RAM Allocation Guide

Player CountRecommended RAM
1-104 GB
10-306-8 GB
30-508-12 GB
50-10012-16 GB
100+16+ GB

GC Log Analysis

hljs bash
# Enable GC logs
java -Xlog:gc*:file=gc.log:time,uptime,level,tags -jar paper.jar

# Analyze GC logs
grep "Pause" gc.log | tail -20

Conclusion

Minecraft server optimization is achieved through proper server software selection, JVM flags, chunk loading configuration, and plugin management. Regular TPS monitoring and Spark profiling help identify and resolve performance issues. REXE VDS high-performance NVMe SSDs and powerful CPUs ensure your Minecraft server runs at peak performance.