HeapDumper dumps virtual threads in 2 places: - dumping platform threads (mounted virtual threads are dumped as separate thread object); - dumping heap objects when the object is `java.lang.VirtualThread`.
In the 2nd case mounted virtual threads should be skipped (as they are already dumped with correct stack traces/stack references) Check that a virtual thread is mounted is non-trivial, method from JvmtiEnvBase was used for this. Testing: tier1..3, heapdump-related tests: open/test/hotspot/jtreg/serviceability,open/test/hotspot/jtreg/runtime/ErrorHandling,open/test/hotspot/jtreg/gc/epsilon,open/test/jdk/sun/tools/jhsdb ------------- Commit messages: - jcheck - JDK-8322237 Changes: https://git.openjdk.org/jdk/pull/17134/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17134&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322237 Stats: 25 lines in 2 files changed: 23 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/17134.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17134/head:pull/17134 PR: https://git.openjdk.org/jdk/pull/17134