Get the latest tech news

Java Virtual Threads: A Case Study


This article explores JDK 21's virtual threads, comparing their performance with Open Liberty's thread pool. It covers key findings like throughput, ramp-up times, and memory footprint. Despite advantages, virtual threads showed unexpected performance issues, especially in CPU-intensive workloads. This analysis guides Java developers on when and how to use virtual threads in their applications.

To evaluate a use case that would exercise virtual thread unmount and mount actions, we used an online banking simulation app that generates a request to a remote system, which responds after a configurable delay. This does not indicate a problem with virtual threads: how long DirectByteBuffers memory is retained depends on the interplay of several factors, including transaction duration, Java heap nursery size, and tenure promotion timing. We would like to acknowledge and appreciate Doug Lea(a leader in Java concurrency work and the author of the ForkJoinPool class) and others in the OpenJDK community for their assistance in our investigation of these virtual threads performance issues.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Java

Java

Photo of case study

case study

Photo of java virtual threads

java virtual threads

Related news:

News photo

1JPM: A Maven/Gradle alternative in a single Java file

News photo

Anna O.: The woman behind Freud's first case study

News photo

Will sending `kill -11` to Java process raises a NullPointerException?