RFR: 8357650: ThreadSnapshot to take snapshot of thread for thread dumps

Alex Menkov amenkov at openjdk.org
Sat May 24 00:22:14 UTC 2025


This is first (hotspot) part of the update for `HotSpotDiagnosticMXBean.dumpThreads` and `jcmd Thread.dump_to_file` to include lock information in thread dumps (JDK-8356870).
The update has been split into parts to simplify reviewing.
The fix contains an implementation of `jdk.internal.vm.ThreadSnapshot` class to gather required information about a thread.
Second (dependent) part includes changes in `HotSpotDiagnosticMXBean.dumpThreads`/`jcmd Thread.dump_to_file`, spec updates and tests for the functionality.

Testing: new `HotSpotDiagnosticMXBean.dumpThreads`/`jcmd Thread.dump_to_file` functionality was tested in loom repo;
  sanity tier1 (this fix only)

-------------

Commit messages:
 - initial fix

Changes: https://git.openjdk.org/jdk/pull/25425/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25425&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357650
  Stats: 736 lines in 8 files changed: 733 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25425.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25425/head:pull/25425

PR: https://git.openjdk.org/jdk/pull/25425


More information about the core-libs-dev mailing list