From f59f5167d188e015ec96473ac8f98c1e560fc08a Mon Sep 17 00:00:00 2001 From: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:31:58 +0300 Subject: [PATCH 1/3] update Virtual Threads docs Signed-off-by: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> --- .../modules/reference/pages/features/spring-application.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc index 72f8eb70fffc..a7a12fc5b1f2 100644 --- a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc +++ b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc @@ -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. From 4a725823aa0ce14efe8bd7c86533b4e7fbd0784c Mon Sep 17 00:00:00 2001 From: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:07:29 +0000 Subject: [PATCH 2/3] Reword Pinned Virtual Threads note Signed-off-by: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> --- .../modules/reference/pages/features/spring-application.adoc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc index a7a12fc5b1f2..af0ed809f83b 100644 --- a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc +++ b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc @@ -402,10 +402,7 @@ Spring Boot can also be configured to expose a xref:api:rest/actuator/startup.ad If you're running on Java 21 or up, you can enable virtual threads by setting the property configprop:spring.threads.virtual.enabled[] to `true`. -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. +We recommend using Java 24 or later as Java 21 have a "Pinned Virtual Threads" issue that happens when entering a `synchronized` block or method; however, before turning on Virtual Threads option for your application, you should consider https://docs.oracle.com/en/java/javase/24/core/virtual-threads.html[reading the official Java virtual threads documentation] In case your code calls a native method or a foreign function inside Virtual Thread, 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.. 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. From ea252b3dee7e52483b7e94514fac18eaa40d93f3 Mon Sep 17 00:00:00 2001 From: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:22:10 +0000 Subject: [PATCH 3/3] delete dat Signed-off-by: Zakaria Shahen <35308232+zakaria-shahen@users.noreply.github.com> --- .../modules/reference/pages/features/spring-application.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc index af0ed809f83b..4ae8913d4695 100644 --- a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc +++ b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/spring-application.adoc @@ -402,7 +402,7 @@ Spring Boot can also be configured to expose a xref:api:rest/actuator/startup.ad If you're running on Java 21 or up, you can enable virtual threads by setting the property configprop:spring.threads.virtual.enabled[] to `true`. -We recommend using Java 24 or later as Java 21 have a "Pinned Virtual Threads" issue that happens when entering a `synchronized` block or method; however, before turning on Virtual Threads option for your application, you should consider https://docs.oracle.com/en/java/javase/24/core/virtual-threads.html[reading the official Java virtual threads documentation] In case your code calls a native method or a foreign function inside Virtual Thread, 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.. +We recommend using Java 24 or later as Java 21 have a "Pinned Virtual Threads" issue that happens when entering a `synchronized` block or method; however, before turning on Virtual Threads option for your application, you should consider https://docs.oracle.com/en/java/javase/24/core/virtual-threads.html[reading the official Java virtual threads documentation] In case your code calls a native method or a foreign function inside Virtual Thread, 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. 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.