Skip to content

Improve Virtual Threads section to mention the changes in Java 24 #46547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ If you're running on Java 21 or up, you can enable virtual threads by setting th
Before turning on this option for your application, you should consider https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html[reading the official Java virtual threads documentation].
In some cases, applications can experience lower throughput because of "Pinned Virtual Threads"; this page also explains how to detect such cases with JDK Flight Recorder or the `jcmd` CLI.

When utilizing virtual threads, we advise upgrading to Java 24 or later. According to https://openjdk.org/jeps/491[JEP 491], Java 24 allows synchronizing virtual threads without pinning; however, pinned virtual threads still occurs when a native method or a foreign function is called on.

NOTE: If virtual threads are enabled, properties which configure thread pools don't have an effect anymore.
That's because virtual threads are scheduled on a JVM wide platform thread pool and not on dedicated thread pools.

Expand Down