Java learning pathSection 22

JVM Diagnostic Tools

Use JVM command-line and GUI tools to inspect runtime health and performance.

1

jps

jps lists JVM processes running on the machine and their identifiers.

It is a quick way to identify the Java process you need to inspect.

Find a live JVM with jps, collect heap, thread, and GC evidence with jcmd, jstack, jmap, and jstat, then diagnose and fix or tune; heap dumps and JFR recordings have dedicated analysis tools.
jps
2

jstack

jstack prints thread dumps and stack traces from a running JVM.

It is used to diagnose deadlocks, dead waiting states, and high CPU consumption.

3

jmap

jmap reports heap usage, memory mappings, and heap dump options for a JVM process.

It helps inspect object retention and identify memory pressure.

4

jcmd

jcmd sends diagnostic commands to a running JVM process and exposes advanced management features.

It is one of the most flexible tools in the JDK toolset.

5

jstat

jstat provides JVM statistics such as class loading, memory usage, and GC activity over time.

It is useful for trend analysis and runtime monitoring.

6

jinfo

jinfo prints configuration and JVM flags for a running Java process.

It is helpful for verifying settings such as heap size and GC selection.

7

javap

javap disassembles class files and prints their structure and bytecode.

It is frequently used to inspect compiled code and verify the bytecode generated by the compiler.

8

jconsole

jconsole provides a graphical monitoring view of heap, threads, and CPU usage.

It is useful for quick diagnostics without writing custom tooling.

9

VisualVM

VisualVM is a richer GUI-based diagnostic tool for profiling, heap inspection, and thread analysis.

It integrates well with JFR and can help find performance bottlenecks quickly.

10

Eclipse MAT

Eclipse MAT is a heap analysis tool used to inspect memory snapshots and identify retained objects.

It is particularly helpful when diagnosing memory leaks and large retention trees.

11

JMC

Java Mission Control is a monitoring and analysis suite built around JFR data.

It provides deep insights into runtime events and JVM behavior over time.

12

JFR

Java Flight Recorder captures low-overhead profiling and diagnostic events.

It has become a standard tool for production-grade JVM analysis.