Sampler Wiki › Guides › Sampler Advanced Analysis with VisualVM
Sampler Advanced Analysis with VisualVM
For deep-dive analysis, Sampler exports .nps files that can be opened in VisualVM, a Java profiling tool.
Analysis Workflow
- Load the File: In VisualVM, go to
File > Load, set the filter to "Profiler Snapshots," and select your exported.npsfile. - Identify the Thread: Locate the "Server thread" (for
/samplerexports) or "Client thread" (for/csamplerexports). - 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.
- 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
- 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).