Why jstack Can Miss Blocked Requests in Java Services Using Virtual Threads
A Spring Boot service with virtual threads and a 10-connection HikariCP pool can show climbing latency while thread dumps look nearly idle. Standard jstack and jcmd Thread.print output lists platform threads, such as the carrier threads that run virtual threads, so waiting requests may not appear. On JDK 21 through 25, the author recommends using jcmd Thread.dump_to_file, which captures virtual threads as well, with plain or JSON output depending on needs. Dump contents vary by JDK version, with JDK 25 adding state, timestamps, and lock information. Counting and inspecting stacks that include HikariPool.getConnection can reveal how many requests are queued on the database pool.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in