Diagnosing Minecraft Server Lag with Spark Profiler | NodeFlux.eu Docs
Use the Spark performance profiling plugin to pinpoint tick lag causes, memory leaks, and entity bottlenecks.
Steps
- Install the spark plugin JAR into your plugins folder (or mod folder for Fabric/Forge) and restart the server.
- When experiencing lag or low TPS, run the console command: /spark sampler --duration 60.
- Wait 60 seconds for the profiler to collect CPU thread telemetry across game ticks.
- Open the generated spark view web link provided in the console response.
- Examine the CPU call tree to see whether lag originates from mob pathfinding, redstone clocks, plugin listeners, or chunk loading.
- Run /spark heap to capture a snapshot of JVM memory allocations when investigating high RAM usage or GC pauses.
Notes
- Spark has virtually zero performance overhead while sampling, making it safe to run on live community servers.
- Analyzing heap dumps helps identify which plugins hold onto unused object references.
Related NodeFlux pages
- Managing Player Permissions and Ranks with LuckPerms — Learn how to install LuckPerms, configure permission groups, assign admin ranks, and use the web editor.
- Pre-Generating Minecraft Chunks with Chunky — Eliminate chunk loading lag spikes caused by exploring players by pre-generating world terrain with Chunky.
- Setting up GeyserMC and Floodgate for Bedrock Cross-Play — Allow Bedrock players on mobile, Xbox, PlayStation, and Switch to join your Java Paper or Purpur server.