spark | Find the Real Cause of Minecraft Lag
MODS · minecraft mods

spark | Find the Real Cause of Minecraft Lag

spark is a performance profiler for Minecraft that shows you exactly which mods, ticks or memory hogs are causing lag, on both clients and servers.

By Nov 30, 20260 views
Compatible with
26.3
FabricForgeNeoForgeQuilt

You know the feeling. Twenty mods into a pack, the server starts stuttering every few minutes and the log file tells you nothing useful. Or your client drops into a slideshow next to a big mob farm and you have no idea which of your installed mods is responsible. spark turns that guessing into a call graph. It does not raise your FPS. It shows you where the CPU time actually goes, which ticks are running long, and which classes are filling up the heap.

What the CPU Profiler Actually Records

spark is a sampling profiler. While a session runs, it takes statistical samples of JVM activity and builds a call graph from them. Stop the session and the report opens in the online viewer, where you get a link code you can share with anyone helping you read it.

About 30 seconds of recording is usually enough to produce useful insight. That matters, because you can profile a live server without taking it down and you do not have to reproduce a lag spike in a test world.

The command flow is short. /spark profiler start begins a session, stop ends it and uploads, open launches the viewer without stopping, cancel throws the recording away, and info tells you what is running. The flags are where the tuning happens. Use --timeout to stop automatically after a set number of seconds. Use --thread with an asterisk to sample every thread, or name a specific thread and add --regex to match it. Use --only-ticks-over with a millisecond value to record only the slow ticks, which strips out the noise from normal gameplay. Use --interval to change the sample rate, and stop --save-to-file to keep a report on disk instead of uploading it.

Two engines sit behind this. The native engine uses async-profiler and is only available on Linux x86_64 systems. Everywhere else spark falls back to the built-in Java engine based on ThreadMXBean, which the project describes as an improved version of WarmRoast. The viewer can apply deobfuscation mappings, so the stack traces come back readable. The full command reference lives in the spark documentation.

Memory Tools: Heap Summary, Heap Dump and GC Monitoring

Lag is not always a CPU problem. If your server freezes for a second and then catches up, memory pressure is a good suspect, and spark has three tools for it.

A heap summary takes a quick snapshot of the heap and shows memory use and instance counts for each class. It is a fast look, not a replacement for a full analysis tool. A heap dump writes a complete HPROF snapshot you can open in the conventional analysis software, and spark can compress it to keep the file manageable. GC monitoring watches garbage collection activity, shows how long collections take and how much memory they free, and lets you relate a pause to a server hang. Watching the frequency and duration of young and old generation collections is how you decide which GC tuning flags to change.

If the summary keeps pointing at the same class growing without limit, the problem is often a leak rather than a tuning issue, and Memory Leak Fix is the follow-up read.

Health Reports, TPS and the Live Dashboard

The health side of spark is the part you will use daily. /spark tps reports ticks per second to a more accurate degree than the standard command. /spark health opens a live dashboard that refreshes itself every 10 seconds, showing tick durations (minimum, maximum and average), CPU usage for both the server process and the whole system, memory usage, and free disk space.

Tick monitoring goes further. Turn it on and spark sends a report whenever a single tick runs past a threshold you set. Instead of a vague "the server lags at night", you get a record of exactly which ticks were slow and what else was happening around them.

Access runs on permission nodes, so on a shared server you can hand out spark.profiler, spark.health, spark.tps, spark.ping or spark.tickmonitor separately instead of the whole tool at once.

Reading a report is one job. Fixing the tick loop is another, and Krypton covers the network and tick side of that.

How to Install spark

The install is a single jar drop, whether you are profiling a client or a server. If you have never added a mod by hand, our mod install guide walks through the folder layout.

  1. Download the spark jar from the official project page.
  2. Put the jar in the mods folder. On a client that is your game's mods directory. On a server it goes in the mods or plugins folder, depending on the platform.
  3. Restart the game or the server so the jar loads.
  4. Run /spark in chat or the console to confirm it loaded. spark runs on Fabric, Forge, NeoForge and Quilt.

FAQ

Does spark work on the client and the server? Both. spark is optional on each side, so you can run it in your own mods folder, on the server, or in both places. On a client install the command prefix becomes /sparkc instead of /spark.

Is it safe to profile a live server? The profiler is built to run in production with minimal impact. A session of around 30 seconds produces useful data, and --only-ticks-over narrows the recording to slow ticks only. You do not have to take the server offline.

Do I need to configure anything? No. Install it and run a command. The project calls the config options niche, and the config.json file is not generated for you. If you do need to change something, you can use a config.json in the spark folder, SPARK_ environment variables, or system properties.

Is spark still maintained? Yes. The project is actively updated, with releases through September 2026, and it has around 25 million downloads. It is open source under the GNU GPLv3.

That is the whole job: record, read the tree, fix the thing it points at. Once the report is clear, pair spark with Lithium for tick work and profile again to confirm the change landed.

Discussion

No comments yet

Be the first to start the discussion.