How to Install and Use Spark Profiler on Your Minecraft Server

Install Spark to diagnose lag, monitor TPS, generate flame graphs, and identify the exact plugin or mod causing performance issues on your Minecraft Java server.

Spark is the standard performance profiler for Minecraft servers. It monitors TPS, MSPT, CPU usage, and memory — and most importantly, it generates flame graphs that show exactly which plugin, mod, or game system is eating tick time. If your server has lag, install Spark before changing anything else.

What Spark Tells You

MetricWhat it means
TPS (ticks per second)Should be 20.0. Below 18 = noticeable lag
MSPT (ms per tick)Time per tick. >50 ms = below 20 TPS
CPU usagePer-thread CPU consumption
MemoryHeap usage and GC pressure
Profiler flame graphPer-class breakdown of where tick time goes

Install Spark

Check if Spark is already installed

Paper 1.21+ includes Spark by default. In Console in the XGamingServer Panel, run:

spark tps

If you get TPS output, you're done. If you see Unknown command, continue.

Download the right Spark build

Go to spark.lucko.meDownloads and pick the build for your server type:

Server typeBuild
Paper / Spigot / Bukkitspark-X.X.X-bukkit.jarplugins/
Forgespark-X.X.X-forge.jarmods/
NeoForgespark-X.X.X-neoforge.jarmods/
Fabricspark-X.X.X-fabric.jarmods/
Velocityspark-X.X.X-velocity.jarplugins/
BungeeCordspark-X.X.X-bungeecord.jarplugins/

Upload to your server

Click Files in the panel sidebar. Navigate to plugins/ (or mods/), and upload the Spark JAR.

Restart the server

Restart from Console. Confirm Spark loaded by running /spark tps.

Diagnose Lag with the Profiler

This is the workflow for finding any source of server lag.

Check current TPS

In Console or in-game:

/spark tps

Output looks like:

TPS from last 5s, 10s, 1m, 5m, 15m: 18.2, 17.8, 19.1, 19.5, 19.8

Anything sustained below 18 is a problem.

Start the profiler

/spark profiler start

Spark begins recording samples. Let it run for 2–5 minutes during normal gameplay (or while the lag is happening).

Stop the profiler

/spark profiler stop

Spark generates a public web URL like https://spark.lucko.me/abc1234. Open it in your browser.

Read the flame graph

The graph shows where tick time is going:

  • Wider bars = more time spent in that code
  • Top of stack = leaf functions (the actual work)
  • Plugin/mod package names (e.g., me.someplugin.) reveal the culprit
  • Look for MinecraftServer.tickChildren as the entry — drill down from there

Reading Common Patterns

What you see in the reportWhat it meansFix
EntityType.tick for one mob typeMob farm with too many of that mobFarmControl / ClearLagg
ChunkMap / ChunkHolderToo many loaded chunksLower view-distance
LevelChunk.tickBlocksHeavy redstone or block ticksSwitch to Purpur, simplify redstone
Specific plugin package wide barsThat plugin is the bottleneckUpdate or remove
GarbageCollectorRAM pressure / GC pausesAikar's Flags, right-size RAM
PathfinderMobs stuck in pathfinding loopsLimit mobs in laggy areas
BlockPos.getY everywhereMath overhead from a buggy pluginUpdate the plugin

Memory Diagnostics

If RAM is the problem (frequent OOM, high GC), use:

Check heap usage

/spark health

Shows current and max heap, GC stats, and CPU info.

Generate a heap dump

/spark heapdump

Creates a .hprof file you can open in tools like Eclipse MAT or VisualVM to find memory leaks.

Warning: Heap dumps freeze the server briefly and can be hundreds of MB. Run during low-traffic periods.

Command Reference

CommandDescription
/spark tpsCurrent TPS over multiple intervals
/spark healthServer health summary (TPS, MSPT, CPU, RAM, GC)
/spark profiler startStart CPU profiling
/spark profiler stopStop and generate report URL
/spark profiler --interval 4 --thread *Profile all threads at 4ms intervals
/spark gcGarbage collection statistics
/spark heapdumpGenerate .hprof heap dump
/spark heapsummaryQuick text summary of heap contents
/spark pingShow player ping stats
/spark activityRecent profiling activity

Tips for Useful Profiles

  1. Profile during the actual lag — a profile of a healthy server tells you nothing
  2. Profile for at least 60 seconds — short profiles miss intermittent issues
  3. Profile during peak player count — many issues only appear under load
  4. Don't profile during world generation — chunk gen will dominate the report
  5. Compare profiles — run one when healthy, one when laggy, and compare

Sharing Spark Reports

Spark reports include a public shareable URL by default. To share with support or our Discord:

/spark profiler stop

Copy the URL from chat and paste it. Anyone with the link can view it (no login needed).

Common Mistakes

MistakeFix
Stopping the profiler too earlyRun for at least 60 seconds, ideally 2–5 minutes
Profiling on an empty serverLag almost always requires player load to reproduce
Reading only the top of the flame graphDrill into tickChildren to find the real cost
Reinstalling Spark on every errorThe report is the answer — read it carefully
Ignoring /spark healthIt's the fastest way to spot RAM/CPU bottlenecks
Asking for help without the linkAlways share the Spark URL — text descriptions aren't enough

How is this guide?

40% Off — Limited TimeGet your Minecraft server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page