HeapStats is Java troubleshooting tool.
This tool suites of three applications.
Also two supplemental applications are available:
Agent gathers various JavaVM runtime information such as the below.
More detailes are here.
NOTE: For JDK 8u262 or later, we recommend to use built-in agent, JDK Flight Recorder, instead of HeapStats
You can attach HeapStats agent by any way of the following:
-agentlib:heapstats[=conf]
libheapstats.so
from library path.libheapstats.so
should be resolved via LD_LIBRARY_PATH
or library path (e.g. /etc/ld.so.conf
)-agentpath:/path/to/heapstats[=conf]
libheapstats.so
from specified pathheapstats-attacher
jcmd <PID> JVMTI.agent_load /path/to/libheapstats.so
JVMTI.agent_load
has been introduced in Java 9See also: HeapStats Builder
Analyzer is GUI application for analyzing data which are collected from Agent.
Also it supports JDP autodiscovery and Error Report Transmission.
Linux x64 or Windows x64
Run <analyzer dir>/bin/heapstats-analyzer
(Linux) or <analyzer dir>\bin\heapstats-analyzer.bat
(Windows)
The automatic discovery on JDP (Java Discovery Protocol) can be enabled by the following JVM options.
-Dcom.sun.management.jmxremote.port=<JMX port>
-Dcom.sun.management.jmxremote.authenticate=<true|false>
-Dcom.sun.management.jmxremote.ssl=<true|false>
-Dcom.sun.management.jmxremote.autodiscovery=true
JDP sends a packet per 5 seconds by default. If Analyzer can NOT receive a JDP packet from a monitoring JVM instance, color of its name on the screen will become orange.
Oracle JDK can provide a real-time detection of JVM crash, but OpenJDK DOES NOT support it. In addition, Oracle JDK needs to be run with the following options.
-XX:+TransmitErrorReport
-XX:ErrorReportServer=<address>:<port (4711 by default)>
NOTE: Error Report Transmission has been removed since JDK 12
HeapStats Analyzer supports custom plugin. See SamplePlugin for details.
If you want to analyze data which are collected by HeapStats Agent on CUI environment, you can use HeapStats CLI.
Linux x64 or Windows x64
Run <cli dir>/bin/heapstats-cli
(Linux) or <cli dir>\bin\heapstats-cli.bat
(Windows)
If you want to see options, please run heapstats-cli
with -help
.
More detailes and released binaries are available on icedtea community: http://icedtea.classpath.org/wiki/HeapStats
$ configure --with-jdk=/path/to/jdk13
$ make
Contribution are most welcome! HeapStats is an open source project under the GNU General Public License, version 2. See CONTRIBUTING.md for details.