Quality Outreach Heads-up - JDK 24: Remote Debugging with jstat and jhsdb Is Deprecated for Removal
Nicolai Parlog on January 31, 2025The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.
Moving Away From RMI
Java’s Remote Method Interface (RMI) was introduced in 1997 to allow transparent remote procedure calls from one Java Virtual Machine to another. It uses serialization to encode objects as bytes when transporting them as arguments and return values between JVMs. Both technologies have long-term security concerns and configuration difficulties and did not stand the test of time. Today, the wider ecosystem has replaced RMI with more web friendly protocols and so Java itself is also reducing and removing dependencies on it where possible.
Local Measurements and Debugging
Among other tools, Java offers these two to connect to a local HotSpot JVM and observe or debug it as well as the program it executes:
jstat
displays performance statistics (using the attach API)jhsdb
provides snapshot debugging and analysis features (based on the Serviceability Agent)
Both tools’ capabilities for local use remain in place and there are no plans to change that.
Remote Use Deprecated for Removal
Both jstat
and jhsdb
offer remote capabilities, which are implemented using RMI.
Due to the aforementioned effort to reduce dependencies on RMI, jstat
’s and jhsdb
’s remote capabilities are deprecated for removal:
jstatd
(allows remote connections withjstat
) - JDK-8327793jhsdb debugd
(allows remote connections withjhsdb
) as well as the--connect
option of thejhsdb
subcommandshsdb
andclhsdb
- JDK-8338894
Questions or feedback on these deprecations can be directed at the serviceability-dev mailing list.
Alternatives
An alternative tool for getting remote insights into a running HotSpot JVM is the JDK Flight Recorder (JFR).