Project Loom VirtualThreads hang
Ron Pressler
ron.pressler at oracle.com
Thu Jan 5 15:13:06 UTC 2023
> On 5 Jan 2023, at 12:36, robert engels <rengels at ix.netcom.com> wrote:
>
> which is interesting because the #1 consumer is still the ForkJoin pool parking while waiting for work - even though the system and idle percentages are so low.
Parks in the scheduler are usually a result of workers being starved for work due to a high relative rate of contention. A high relative contention rate is usually an application problem and shouldn’t be common in well-architected ones. Try adding more instances of a queue+producers+consumers, and you should see fewer parks. Alternatively, reduce the scheduler’s parallelism with `-Djdk.virtualThreadScheduler.parallelism=N` where N is smaller than the number of cores. In these situations (that typically arise only in artificial benchmarks) the result could even be improved overall performance.
— Ron
More information about the loom-dev
mailing list