CYBER DEAL UP TO -40% FIRST YEAR
Glossary background texture

What is Spark in Minecraft? Everything You Need to Know.

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):

  1. Download the Spark plugin JAR from SpigotMC
  2. Place it in your plugins folder
  3. Restart the server

For modded servers (Fabric, Forge, NeoForge):

  1. Download the Spark mod JAR from Modrinth or CurseForge
  2. Place it in your mods folder
  3. 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, or PathFinding consuming 30%+ means too many entities. Reduce mob counts or use entity management plugins.
  • Chunk related methods: Methods involving ChunkProvider, ChunkGeneration, or ChunkSave taking significant time means chunk operations are slow. Pre-generate your world or optimize chunk settings.
  • Redstone or tile entity methods: RedstoneTick or TileEntity.tick consuming 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:

  1. Start profiler with /spark profiler
  2. Wait 10 minutes during normal gameplay
  3. Stop with /spark profiler --stop
  4. Look for plugin names dominating the flame graph
  5. Update, reconfigure, or replace that plugin

Diagnosing entity lag:

  1. Profile normally
  2. Look for Entity.tick, MobAI, PathFinding methods
  3. If these methods are wide, you have too many entities
  4. Use /spark health to see entity counts per world
  5. Reduce spawn limits or clear entities

Memory leak detection:

  1. Run /spark profiler --alloc --alloc-live-only
  2. Wait 15+ minutes
  3. Stop the profiler
  4. Look for objects being allocated in huge quantities
  5. Identify the plugin or mod creating these objects

Identifying tick spikes:

  1. Enable async profiling with --thread *
  2. Let it run during lag spikes
  3. Check if spikes correlate with specific methods
  4. 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.
Don't miss out

CYBER DEAL
UP TO -40%

Host a Minecraft Server today with the best Cyber deal discount

  • -40% First Month
  • -10% First Quarter
  • -40% First Year