jstat
jstat is a command-line utility bundled with the Java Development Kit (JDK) that provides real-time statistics about a running Java Virtual Machine (JVM). It is designed for lightweight monitoring of memory usage, garbage collection, class loading, and related VM activities with minimal overhead, making it useful for quick diagnostics and tuning tasks. The tool is available on platforms that run the JDK, including Windows, macOS, and Linux.
Overview: jstat connects to a target VM and prints selected statistics to standard output. The target is
Usage: Typical usage is jstat -option pid interval count. For example, jstat -gc 1234 1000 5 prints
Remote monitoring: In environments requiring remote access, a jstatd daemon or the Attach API allows querying
Limitations: jstat is primarily designed for HotSpot-based VMs and may not expose all metrics on every JVM