Your server reads a healthy 20 TPS, then three players start a mob farm and everything stutters. Blocks break late, mobs rubber-band, and chat arrives in bursts. Most owners react by buying more RAM, and most of the time that changes nothing, because RAM was rarely the problem.
Lag on a Paper server almost always comes from one of a few places: a garbage collector that freezes the game, too many entities ticking at once, terrain generating on the fly, or a single plugin hogging the main thread. Each one has a fix, and most of them are free. Here is how to find yours and what to change, with every setting checked against Paper’s current docs.
What a TPS Drop Actually Is
Minecraft runs on a loop that ticks 20 times per second, which gives each tick a 50 millisecond budget. Mob AI, redstone, hoppers, chunk loading, and plugin events all have to fit inside that window. When a tick runs long, the server falls behind, and TPS drops below 20.
The number worth watching is MSPT, milliseconds per tick. A server can show 20 TPS while MSPT sits at 45, which means it is one busy moment away from lagging. TPS tells you the server already fell behind. MSPT tells you how close it is.
The main tick loop is largely single-threaded. Paper moves some work off it, such as chunk loading, but the core simulation still runs on one thread. That is why CPU clock speed matters more than core count, and why extra RAM cannot rescue a server that is CPU-bound.
Step 1: Find the Cause with Spark
Guessing wastes weekends. Paper has bundled the Spark profiler since version 1.21, and Paper’s docs call it the preferred way to profile a server. The old Timings profiler is deprecated and switched off by default.
Run this while the lag is happening:
/spark profiler start --timeout 600
After ten minutes, Spark gives you a link to a report. Profiling only works if the problem is actively occurring, so start it when players are online and the server feels bad. The report shows which methods and plugins eat the most tick time. Two quick commands help along the way: /spark tps for a snapshot and /spark health for memory, GC, and CPU stats.
Read the report before changing anything. If a plugin takes a third of the tick, no JVM flag will help. If the time goes to garbage collection, the next two steps are for you.
Step 2: Use the Right Java Version and Heap Size
Minecraft 26.1 and newer needs Java 25 on the server. Paper’s 26.x builds expect it too, so a startup script still pointing at Java 21 will not start the server.
For memory, Paper’s docs recommend at least 6 to 10GB, no matter how few players you have. They also say more memory stops helping past a certain point, so a 32GB heap on a small server wastes money. The other rule people miss: never hand Java your whole allocation. Java needs memory on top of the heap, so subtract about 1000 to 1500MB from what your host gives you. On an 8GB plan, Paper suggests 6500MB for the heap. If you are unsure what your server needs, Cybrancee’s Minecraft RAM calculator estimates it from your loader and player count. Our guide on how much RAM a Minecraft server needs goes deeper.
Set -Xms equal to -Xmx. Paper’s reasoning is that G1 handles memory better when it has the full amount from the start, and any gap between the two is just unused RAM.
Step 3: Add Aikar’s Flags
Aikar’s flags are the JVM options in Paper’s documentation for its servers. They tune the G1 garbage collector for Minecraft’s unusual memory habits. According to Paper’s docs, a 30-player server can allocate around 800MB per second, mostly short-lived objects like block positions. Default settings cope badly with that, so the flags give the young generation more room.
Here is the command from Paper’s docs, using their 10GB example. Swap in your own heap size.
java -Xms10G -Xmx10G -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
You do not need to memorize all of it, but a few flags explain most of the benefit:
- MaxGCPauseMillis=200 sets a pause goal of about four ticks. Paper notes that players cannot perceive 200ms, and pushing the target lower can leave G1 too little time to clean up old memory.
- DisableExplicitGC stops plugins from forcing a full garbage collection, which causes a big lag spike.
- G1HeapRegionSize=8M keeps large allocations from being treated as humongous objects that go straight to old memory.
- AlwaysPreTouch reserves the heap at startup, so you pay a slightly slower boot for steadier performance later.
If you want to see whether GC is really your problem, add -Xlog:gc*:logs/gc.log:time,uptime:filecount=5,filesize=1M on Java 11 and newer. Paper says GC logging does not hurt performance and can stay on permanently, and the five rotating files take about 5MB.
Want every flag explained, plus how garbage collection works in the first place? Read our deep dive blog, What Is Garbage Collection in Minecraft Servers?
Step 4: Cut the Work Your Server Does Every Tick
Flags clean up memory. Config changes reduce how much work exists in the first place, and this is where the biggest gains usually are.
server.properties. Both view-distance and simulation-distance default to 10. Simulation distance controls how far from players entities and blocks get ticked, so it hits your CPU hardest. Dropping it from 10 to 6 means roughly 60 percent fewer chunks ticking around each player. Try 6 to 8 and see what your players tolerate.
spigot.yml. Under world-settings.default.entity-activation-range, the defaults are 32 for animals, monsters, and villagers. Lowering animals and villagers to 16 makes distant mobs tick less often. Also check mob-spawn-range, which defaults to 8 chunks. Keep it at or below your simulation distance so the server does not attempt spawns in chunks that are barely active.
config/paper-world-defaults.yml. This file replaced the old paper.yml, and a few of its settings pay off quickly:
environment.optimize-explosions: truecaches entity lookups during explosions. It is off by default.collisions.max-entity-collisionsdefaults to 8. Lowering it to 2 cuts collision checks in crowded pens.misc.update-pathfinding-on-block-update: falsestops mobs from recalculating paths whenever a block changes. Paper recommends it when you have lots of entities plus farms or redstone clocks.hopper.disable-move-event: trueimproves hopper performance dramatically, but it breaks any protection plugin that listens for that event. Skip it if you run claims or anti-grief plugins.
In bukkit.yml, lower the spawn-limits if your mob caps are being filled by farms. Paper’s per-player-mob-spawns is on by default, so the cap is spread across players instead of one person using all of it.
Change a few settings at a time, restart, and run Spark again. If you change ten things at once, you will never know which one worked.
Step 5: Stop Chunk Generation Spikes
Exploring new terrain is one of the most expensive things a server does. Every new chunk has to be generated, and a player flying across the map with an elytra can drag the tick rate down for everyone.
The fix is to generate the world before anyone gets there. The Chunky plugin pregenerates a radius around spawn while the server is quiet. Install it, then run chunky radius <number> followed by chunky start. Check its page for the version it supports before you update Minecraft. Pair it with a world border so players cannot wander past what you generated.
Storage speed matters too. NVMe drives load and save chunks much faster than older disks, and Cybrancee’s Minecraft servers run on NVMe with Ryzen CPUs clocked above 4GHz, which helps with both disk stalls and the single-threaded tick.
Step 6: Tame Farms, Hoppers, and Plugins
Spark will usually point at one of these.
Item and mob farms create thousands of entities. Paper has built-in tools before you reach for a plugin: alt-item-despawn-rate lets you make junk like cobblestone despawn faster, and entity-per-chunk-save-limit caps how many of a given entity get saved per chunk.
Redstone is the other usual suspect. Paper supports an alternative redstone implementation through misc.redstone-implementation, with Alternate Current as an option. Be careful here, because Paper warns that both alternatives change how redstone dust behaves, and some contraptions will break.
For plugins, the spark report names the offender. Update it, change its config, or replace it. Be wary of anti-lag plugins that delete entities on a timer. They can eat player loot and often duplicate what Paper already does for free. For more general tips, see our Preventing Minecraft Lag: Ultimate Guide.
Settings and Advice You Can Skip
Old guides still circulate, and some of their advice is out of date.
You may see advice to switch to ZGC. It is a legitimate low-latency collector, and Java’s own docs say it avoids stopping application threads for more than a millisecond. But Paper’s documented recommendation is still Aikar’s G1 flags, and we would not switch without a spark or GC log showing pauses are the real bottleneck. If you do try it, drop -XX:+ZGenerational from any guide. That option was removed in JDK 24, and ZGC is generational by default now.
Do not stack flags from three different guides. Mixed tuning from different Java eras can fight each other. Pick one documented set, test it, and leave it alone.
Transparent huge pages are listed in Paper’s docs as an advanced experiment. They only make sense with AlwaysPreTouch set, and Paper says it has not measured the impact for Minecraft. Skip it unless you enjoy benchmarking.
Which Fix Do You Need?
Small friends server, under 10 players: Start with Java 25, a sensible heap, and Aikar’s flags. Drop simulation distance to 8 and install Chunky. That is probably all you need.
Public survival server with farms: Run spark during peak hours and look at entities and hoppers first. Lower activation ranges, use the per-world Paper settings, and cap item despawn times.
Server with plenty of plugins: Your spark report matters more than any flag. Find the plugin that dominates the profile and fix that one.
Modded or hybrid server: Heavy packs need more memory and a faster CPU than Paper tuning can give you, so check your pack’s recommended RAM before anything else. If you are still choosing between Forge and Paper, our Forge vs. Paper guide helps.
Lag only after exploring: Pregenerate with Chunky and check that your storage is NVMe.
Summary
Minecraft server lag comes from the 50 millisecond tick budget being exceeded. MSPT is a better early warning than TPS, and spark, which Paper has bundled since 1.21, tells you what is consuming the budget.
Minecraft 26.1 and newer needs Java 25. Paper’s docs recommend a heap of at least 6 to 10GB, with -Xms matching -Xmx and 1000 to 1500MB left free for the system. Aikar’s flags tune G1 for Minecraft’s heavy allocation rate, and Paper still documents them as the standard set.
Config changes cut work directly. Lower simulation distance, tighten activation ranges, and use the Paper world settings that fit your server, such as optimized explosions, fewer collisions, and no pathfinding updates on block changes. Disable the hopper move event only if no protection plugin needs it.
Pregenerate your world with Chunky, run on fast storage, and let Spark decide which plugin or farm to fix. Change one thing at a time and measure after each.
Happy optimizing!
Looking for affordable Minecraft Server Hosting? Prices start at $1.99/month, with a 90-day money-back guarantee.