Skip to content
Veltoryx Technologies
ProLesson 9.1Intermediate5 min readUpdated 31 October 2026

Virtual Threads & Project Loom in Spring Boot 3

Supercharge your Spring Boot application throughput with Java 21 Virtual Threads and learn how they replace reactive complexity.

For over two decades, the Java web server architecture was built on a simple rule: one operating system thread per HTTP request.

When an HTTP request reached your Tomcat server, Tomcat assigned it an OS thread from a thread pool (typically capped at 200 threads). While that thread waited for a PostgreSQL query, a Redis cache lookup, or a third-party Stripe API response, it did absolutely zero work—yet it still consumed 1 MB of native memory and held an OS thread hostage.

If 200 users hit a slow query at the same time, all 200 threads got blocked. The 201st request was queued or rejected with an HTTP 503 Service Unavailable.

Enter Java 21 and Spring Boot 3.2+ Virtual Threads (Project Loom).

01The Restaurant Waiter Analogy

Imagine a high-end restaurant:

  • Traditional Platform Threads (The Inefficient Waiter): The waiter takes your order, walks into the kitchen, and stands completely frozen by the chef's counter for 45 minutes until the steak is cooked. Because there are only 200 waiters in town, after 200 tables order, new hungry customers must wait outside in the rain.
  • Virtual Threads (The Smart Waiter): The waiter takes your order, slips the ticket to the kitchen, and immediately walks over to take orders from other tables. When the steak is cooked, any available waiter picks up the plate and delivers it to you.

Virtual threads allow you to write simple, straightforward synchronous code while getting the massive throughput of asynchronous, non-blocking systems.

Virtual Threads in Spring Boot 3.2
Fig. 1 · Virtual Threads in Spring Boot 3.2

Loading the rest of the lesson…