The "Virtual Threads" page (under Core Libraries) has a small section with title "Debugging Virtual Threads" that contains some information on debugging/troubleshooting but there is a lot more to the story. It may also not be easy to find as it doesn't appear to be linked to from any of troubleshooting pages.
It would be useful to create a page on troubleshooting applications that use virtual threads. Some things to list are:
1. The HotSpot VM thread dump prints the stack trace of mounted virtual threads. This is useful to know when chasing issues such as a looping threads.
2. The thread dump produced by jcmd Thread.dump_to_file is significantly updated since JDK 25 to include timestamps, thread state, and lock information.
3. The jdk.VirtualThreadPinned event is significantly improved since JDK 24 to help identify pinning issues beyond the pinning issues with object monitors that were resolved in that release.
4. jdk.management.VirtualThreadSchedulerMXBean was added in JDK 24 that will allow JMX based tools insight into the virtual thread scheduler. jcmd Thread.vthread_scheduler provides similar insight on the command line. These features are documented in JDK releases notes but nowhere else.
5. jcmd Thread.vthread_pollers provides some insight into how many virtual threads are blocked in socket/network I/O.
It would be useful to create a page on troubleshooting applications that use virtual threads. Some things to list are:
1. The HotSpot VM thread dump prints the stack trace of mounted virtual threads. This is useful to know when chasing issues such as a looping threads.
2. The thread dump produced by jcmd Thread.dump_to_file is significantly updated since JDK 25 to include timestamps, thread state, and lock information.
3. The jdk.VirtualThreadPinned event is significantly improved since JDK 24 to help identify pinning issues beyond the pinning issues with object monitors that were resolved in that release.
4. jdk.management.VirtualThreadSchedulerMXBean was added in JDK 24 that will allow JMX based tools insight into the virtual thread scheduler. jcmd Thread.vthread_scheduler provides similar insight on the command line. These features are documented in JDK releases notes but nowhere else.
5. jcmd Thread.vthread_pollers provides some insight into how many virtual threads are blocked in socket/network I/O.