Direct answer
A Java thread dump shows what threads were doing at one moment, whereas a spark profile samples activity over time. Use them together to investigate a hang or a repeated slow operation.
How to check it
- Record the affected Java process PID and capture log context while the issue is present.
- On a host with matching JDK diagnostic tools, use
jcmd <pid> Thread.printto capture a thread dump without terminating the process. - Capture more than one dump several seconds apart if the process appears stuck, then compare repeated stacks.
- For regular tick lag, also capture a spark profile during the affected period.
What to change
- Look for the server thread waiting on I/O, a lock, or plugin code; distinguish WAITING threads from truly blocked work.
- Share redacted thread stacks and corresponding timestamps with the plugin developer when needed.
- Do not assume a single stack snapshot proves the root cause or that every thread shown as WAITING is broken.
Software and version notes
Thread names and synchronization differ between Paper, Folia and mod loaders. The JDK tools used for capture must have permissions to inspect the running Java process.
Practical example: Example: two thread dumps ten seconds apart both show the main server thread waiting on the same database call. That suggests investigating the plugin’s database path and locks. A single thread marked WAITING is not automatically a bug; JVM threads normally wait for work. Match dumps with console times.
Verify the result
- Retake a dump after the suspected blockage is fixed and confirm the original hang no longer reproduces.
- Check corresponding tick-time profiles under the same load.