On Sat, 16 Dec 2023 02:15:16 GMT, Alex Menkov <amen...@openjdk.org> wrote:
> 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 This pull request has now been integrated. Changeset: dd8ae616 Author: Alex Menkov <amen...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/dd8ae616437398f957f9b4f09cf2c7f1d0bd0938 Stats: 35 lines in 2 files changed: 33 ins; 0 del; 2 mod 8322237: Heap dump contains duplicate thread records for mounted virtual threads Reviewed-by: dholmes, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/17134