Spark is a performance profiling plugin and mod for Minecraft servers that diagnoses lag, monitors CPU and memory usage, and generates detailed reports to identify performance bottlenecks. Unlike older tools like timings,
Spark provides method level profiling that shows exactly which lines of code are consuming resources. It works on Spigot, Paper, Fabric, Forge, and other platforms, making it the most versatile profiling tool available for Minecraft.
What Is Spark?
Spark is a modern profiling tool created by lucko (the developer behind LuckPerms) that tracks everything happening on your server at the code level. It records which methods are being called, how long they take, and how often they run. This data gets compiled into interactive flame graphs and call trees that reveal performance problems with precision timings can't match.
The tool runs as either a plugin (Spigot/Paper/Sponge) or a mod (Fabric/Forge/NeoForge). It's lightweight, actively maintained, and has become the standard profiling tool recommended by Paper developers and support communities.
Installing Spark
For plugin servers (Spigot, Paper, Purpur):
- Download the Spark plugin JAR from SpigotMC
- Place it in your
pluginsfolder - Restart the server
For modded servers (Fabric, Forge, NeoForge):
- Download the Spark mod JAR from Modrinth or CurseForge
- Place it in your
modsfolder - Restart the server
For hybrid servers (Sponge, Mohist):
Check Spark's documentation for the correct version. Some platforms require specific builds.
No configuration needed. Spark works immediately after installation.
Reading Spark Reports
When you open a Spark profile link, you'll see a flame graph. This is an interactive visualization where:
- Width represents time: Wider bars mean that method consumed more CPU time.
- Height represents call depth: The bottom shows high level functions. Moving up shows which sub-functions they called.
- Colors are random: They don't mean anything. They just help distinguish adjacent bars.
- Clicking bars zooms in: Click any bar to focus on that specific area of code.
- Percentages show CPU usage: Hover over bars to see exact percentages and method names.
Understanding the Flame Graph
Look for wide bars near the top of the graph. These represent hot spots where your server spends most of its time.
Common patterns:
- One plugin dominating the graph: If a single plugin's methods take 40% of the flame graph width, that plugin is your problem. Check for updates, misconfigurations, or consider replacing it.
- Entity related methods taking huge portions: Methods with names like
Entity.tick,MobAI, orPathFindingconsuming 30%+ means too many entities. Reduce mob counts or use entity management plugins. - Chunk related methods: Methods involving
ChunkProvider,ChunkGeneration, orChunkSavetaking significant time means chunk operations are slow. Pre-generate your world or optimize chunk settings. - Redstone or tile entity methods:
RedstoneTickorTileEntity.tickconsuming large portions indicates redstone lag or too many hoppers/furnaces.
Comparison: Spark vs Timings
Spark and timings both profile performance, but Spark is generally superior:
| Feature | Spark | Timings |
|---|---|---|
| Detail level | Method level, extremely granular | Category level, less detailed |
| Platform support | Plugin and mod platforms | Spigot/Paper only |
| Performance impact | Minimal, async profiling available | Higher overhead |
| Active development | Yes, regularly updated | Abandoned since 2020 |
| Learning curve | Steeper, requires understanding code | Easier for beginners |
| Report format | Flame graphs, call trees | Category breakdowns with percentages |
| Identifying exact lag source | Yes, down to specific methods | No, only general categories |
Timings tells you "PluginX is using 30% of tick time." Spark tells you "PluginX's database query in the PlayerMoveEvent listener is using 30% of tick time."
For experienced troubleshooting, Spark wins. For quick overviews, timings is simpler.
Other Spark Features
Health monitoring:
/spark health
Shows current TPS, CPU usage, memory usage, and disk usage. Quick snapshot of server health without generating a full profile.
TPS monitoring:
/spark tps
Displays TPS history for the last 5 seconds, 10 seconds, 1 minute, 5 minutes, and 15 minutes. More detailed than /tps.
Memory usage:
/spark heapsummary
Shows what's consuming heap memory. Useful for tracking down memory leaks or seeing if you need more RAM.
Garbage collection stats:
/spark gc
Displays garbage collection frequency and pause times. Frequent or long GC pauses indicate memory pressure.
Activity monitoring:
/spark activity
Shows what players are doing that might cause lag. Useful for identifying if specific players are triggering lag events.
Using Spark for Specific Problems
Finding laggy plugins:
- Start profiler with
/spark profiler - Wait 10 minutes during normal gameplay
- Stop with
/spark profiler --stop - Look for plugin names dominating the flame graph
- Update, reconfigure, or replace that plugin
Diagnosing entity lag:
- Profile normally
- Look for
Entity.tick,MobAI,PathFindingmethods - If these methods are wide, you have too many entities
- Use
/spark healthto see entity counts per world - Reduce spawn limits or clear entities
Memory leak detection:
- Run
/spark profiler --alloc --alloc-live-only - Wait 15+ minutes
- Stop the profiler
- Look for objects being allocated in huge quantities
- Identify the plugin or mod creating these objects
Identifying tick spikes:
- Enable async profiling with
--thread * - Let it run during lag spikes
- Check if spikes correlate with specific methods
- Optimize or remove the cause
When to Use Spark
- Your server lags but timings reports look fine: Spark's granular detail reveals issues timings misses.
- A plugin causes lag but you don't know which part: Spark shows exactly which methods in that plugin are slow.
- You're a developer optimizing code: Spark's method level profiling pinpoints performance bottlenecks in your own plugins or mods.
- You need to profile modded servers: Timings doesn't work on Fabric/Forge. Spark does.
- You want async profiling: Spark can profile without impacting server performance. Timings cannot.