Java Debugging Cheat Sheet

JVM flags, jstack, and heap dumps

Last Updated: November 21, 2025

Tools

Tool Purpose
jstack Thread dump
jmap Heap
jcmd Telemetry

Commands

jstack -l
Dump threads
jmap -histo
Heap histogram
jcmd GC.heap_info
Size info

Tips

Capture dumps during peak load and compare across runs.

💡 Pro Tip: Enable heap dumps on OOM and analyze with jvisualvm.
← Back to Developer Tools | Browse all categories | View all cheat sheets