Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Spring Boot can use Java 21 virtual threads by setting spring.threads.virtual.enabled=true. This can let a thread-per-task application handle more concurrent requests when those requests spend substantial time waiting on blocking I/O. It is not a blanket speedup: CPU work, database connections, remote-service limits, and Java 21 pinning can still constrain production capacity.

What changes when Spring Boot uses virtual threads?

Traditional platform threads map to operating-system threads and are comparatively costly to create and keep waiting. A virtual thread is managed by the JDK; during supported blocking operations, it can suspend and free its carrier platform thread to run other work. As JEP 444 puts it, “Virtual threads are a lightweight implementation of threads that is provided by the JDK rather than the OS.” OpenJDK JEP 444

This makes the thread-per-task programming style more practical for workloads with many concurrent tasks that block on I/O. The application can retain ordinary blocking code rather than adopting an asynchronous style solely to avoid tying up a platform thread for every wait. Virtual threads change how waiting tasks use threads; they do not make the work itself disappear.

How do I enable virtual threads in Spring Boot?

  1. Run the application on Java 21 or later. Spring Boot’s current reference says, “Virtual threads require Java 21 or later,” and strongly recommends Java 24 or later for the best experience. The Java 21 guidance below is therefore a baseline, not a claim that all later JDK behavior is identical. Spring Boot reference
  2. Set spring.threads.virtual.enabled=true in the application’s configuration, for example in application.properties.
  3. Test under a representative workload and inspect the limits that actually govern the application, including its database connection pool and remote-service concurrency or rate limits.

When virtual threads are enabled, Spring Boot’s thread-pool configuration properties no longer control execution in the usual way: virtual threads are scheduled using a JVM-wide platform-thread scheduler rather than dedicated application thread pools. Do not treat a larger conventional request-thread pool as the primary tuning control after enabling the feature. Spring Boot reference

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Do virtual threads make Spring Boot faster?

They can improve the concurrency an application sustains when it is constrained by many tasks waiting on blocking I/O. They do not inherently make an individual request faster, accelerate CPU-bound work, or increase a downstream system’s capacity. If a service is already saturated on CPU, database connections, a remote API, or another scarce resource, adding more concurrent virtual-thread tasks may simply move the queue or increase contention.

Workload or constraint What virtual threads change Production implication
Many requests waiting on supported blocking I/O A waiting virtual thread can suspend and release its carrier platform thread. Potentially more concurrent tasks in a thread-per-task design; measure with the application’s real I/O mix.
CPU-bound work Virtual threads do not add CPU capacity or make computation faster by themselves. Do not assume higher CPU-bound throughput.
Database, remote API, or other scarce resource Virtual threads do not expand the resource’s capacity. Keep limits at the relevant boundary; more callers do not mean more available connections or service capacity.
Blocking while pinned on Java 21 The virtual thread cannot unmount from its carrier during the documented pinning cases. Frequent or long blocking while pinned can reduce scalability; investigate before changing synchronization broadly.
Application shutdown and daemon-thread lifecycle Virtual threads are daemon threads. Confirm that the JVM remains alive when scheduled work or other virtual-thread activity is expected to continue.

The official sources do not establish a universal throughput multiplier or a fixed performance winner over platform-thread pools. Compare configurations with a load test that names the tested JDK and Spring Boot versions, workload, blocking mix, and downstream constraints; monitor both application behavior and the systems it calls. OpenJDK JEP 444

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Should I replace my thread pool with virtual threads?

Do not mechanically convert a pool into a pool of virtual threads. JEP 444’s guidance is to create a virtual thread per task, not pool virtual threads. A platform-thread pool and a virtual-thread-per-task approach serve different purposes: the former limits or reuses a finite set of platform threads; the latter makes it cheaper to represent many concurrent tasks, but does not impose limits on the resources those tasks consume.

Keep explicit controls where scarcity exists. For example, a database connection pool still governs how many connections are available; remote-service concurrency and rate limits still need to be respected. Likewise, do not use thread-pool sizing as a proxy for those limits. JEP 444 also cautions that very numerous virtual threads change assumptions about thread-local use: avoid depending on thread locals to pool costly resources across tasks. OpenJDK JEP 444

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

What causes virtual-thread pinning on Java 21?

In Java 21, JEP 444 documents two situations where a virtual thread cannot unmount from its carrier while blocking: when it is executing code inside a synchronized block or method, and when it is executing a native method or foreign function. Pinning is not automatically a bug. The concern is frequent or long blocking while pinned, because the carrier remains occupied and cannot run other virtual threads.

How to investigate

  • Use the JFR event jdk.VirtualThreadPinned to identify pinning during a recording.
  • For targeted tracing, use the documented system property -Djdk.tracePinnedThreads=full to request a full stack trace.
  • Focus on frequent or long-lived blocking while pinned. Do not replace simple or infrequent synchronization indiscriminately; verify that a change addresses an observed bottleneck.

These pinning details describe Java 21’s documented behavior; check the guidance for the exact JDK version deployed rather than assuming later releases behave identically. OpenJDK JEP 444 Oracle Java 21 Virtual Threads guide

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Will virtual threads keep a Spring Boot application alive?

Virtual threads are daemon threads, and a JVM exits when all its threads are daemon threads. This can matter when an application relies on virtual-thread activity, including scheduled work, to continue running. Spring Boot recommends spring.main.keep-alive=true when the application must remain alive even if its threads are virtual. Check the actual lifecycle of the deployed application instead of assuming that a scheduled bean alone keeps the process running. Spring Boot reference OpenJDK JEP 444

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Production decision checklist

  • Confirm the deployed Java and Spring Boot versions; the Spring Boot reference requires Java 21 or later and recommends Java 24 or later for the best experience.
  • Enable spring.threads.virtual.enabled=true only when the application’s task and blocking-I/O profile makes the change relevant.
  • Do not expect the previous thread-pool properties to remain the execution control once virtual threads are enabled.
  • Keep database, remote-service, and other scarce-resource limits explicit at their own boundaries.
  • On Java 21, investigate frequent or long blocking while pinned using JFR or the documented tracing property.
  • If daemon-thread lifecycle could let the JVM exit while work is expected to continue, evaluate spring.main.keep-alive=true.
  • Validate under realistic load; no generic multiplier predicts the result for every application.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.