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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zakaria-shahen
Copy link

No description provided.

Signed-off-by: Zakaria Shahen <[email protected]>
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR but I don't think two full paragraphs on this are what we should be doing. I've added a suggestion.

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we need yet another full paragraph for this. I'd rather see the Java 24 note with the Java 21 note. Something like we recommend using Java 24 as previous versions have an issue.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jul 28, 2025
@snicoll snicoll changed the title update Virtual Threads docs Improve Virtual Threads section to mention the changes in Java 24 Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants