Install or check it
On current Paper and Purpur, run spark to see if it is built in. Otherwise download spark from Modrinth or CurseForge for your platform, Paper, Fabric, NeoForge or Velocity, and install it like any plugin or mod.
Take a profile
Start the profiler while the lag is happening, not afterwards:
- spark profiler start: begin recording
- Wait at least a few minutes while players are online and lag is present
- spark profiler stop: stop and get a link to the report
- spark profiler start --only-ticks-over 100: record only slow ticks, great for spikes
Read the report
The report is a tree of where tick time went. Expand the Server thread and follow the biggest percentages downward. Large shares under a plugin's package name point at that plugin. Time in entity ticking points at mobs or items. Time in chunk loading or world generation points at exploration. Time in block entities points at hoppers, furnaces and modded machines.
The search box helps: type a plugin or mod name to see its total share.
Memory and health
spark health shows TPS, MSPT, CPU and memory. spark heapsummary shows which objects fill memory, useful for tracking leaks. Combined with the panel's memory graph, this tells you whether a bigger plan would help or whether something is wrong.
Sharing reports
The report link can be shared with a plugin author or a helper. It does not include passwords, but it does show plugin names and some world information, so share it with people you trust.