Virtual thread memory leak because TrackingRootContainer keeps threads

Pedro Lamarão pedro.lamarao at prodist.com.br
Tue Jul 2 16:01:01 UTC 2024


Em seg., 1 de jul. de 2024 às 21:02, Brian S O'Neill <bronee at gmail.com>
escreveu:


> If you depended on virtual threads being GC'd when blocked with a real
> infinite timeout, then switching to platform threads would introduce a
> memory leak that didn't exist before. Ideally, the two thread types
> should be interchangeable.
>

But what about an "impossible" wait?
A thread in a pseudo-infinite wait will wake eventually, and the platform
cannot know if this was intentional or not.
But a thread waiting on a blocking queue whose only reference is the thread
itself will never wake, since there is no one to insert into the queue.

--
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240702/4a3dc79f/attachment.htm>


More information about the loom-dev mailing list