Wiki 9Minecraft Wiki 9Minecraft

Sampler Advanced Analysis with VisualVM

Java EditionModGuides 3FAQ 10Related mods 48
DownloadSampler

Get the files on 9Minecraft

Contents (3)
  1. Analysis Workflow
  2. Next guides
  3. More in this wiki

For deep-dive analysis, Sampler exports .nps files that can be opened in VisualVM, a Java profiling tool.

Analysis Workflow

  1. Load the File: In VisualVM, go to File > Load, set the filter to "Profiler Snapshots," and select your exported .nps file.
  2. Identify the Thread: Locate the "Server thread" (for /sampler exports) or "Client thread" (for /csampler exports).
  3. Verify Data Integrity: Check the "Time" vs. "Invocations" columns. Under default settings, there should be roughly 10ms for every invocation. If the numbers are wildly different, the data may be skewed by a GC run.
  4. Expand the Call Tree: Unfold the thread entries to see which methods are consuming the most time.
    • MinecraftServer.tick: High values here indicate entity or block tick lag
    • Thread.sleep: High values here are actually good; they indicate the server has idle time and is not overloaded
  5. Deobfuscation: Note that method names may appear as func_12345_a. These can be translated using MCP mapping files or by identifying the parent class (e.g., net.minecraft.entity.EntityLiving).