[External] : Re: Virtual thread memory leak because TrackingRootContainer keeps threads

Davor Hrg hrgdavor at gmail.com
Wed Jul 3 17:28:49 UTC 2024


I am likely misunderstanding. Could weak reference to VT be ok, to be able
to enumerate from inside the app? And gc to do its thing



On Wed, 3 Jul 2024, 19:24 Attila Kelemen, <attila.kelemen85 at gmail.com>
wrote:

> Maybe Ron will prove me wrong, but I never felt that the design of the JEP
> was meant to make VT appear as PT in all aspects. In fact, what the JEP is
> usually about is that it equates VT with tasks submitted to an executor.
> And in that case, VT being a GC root is a strange thing. Though I think
> either case is unlikely to make a difference in practice.
>
> robert engels <rengels at ix.netcom.com> ezt írta (időpont: 2024. júl. 3.,
> Sze, 16:58):
>
>> I understand, but with a PT thread being a GC, and methods like
>> Thread.enumerate() is was never possibly - and a “service” could always
>> find the “blocked” threads and interrupt them.
>>
>> If VT are not findable (or optionally findable), I think it is a breaking
>> change which goes against the JEP design for virtual threads, and it is
>> going to lead to two different types of patterns for queue handling based
>> on the thread types involved - I think this is a very bad idea.
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240703/a3f27796/attachment.htm>


More information about the loom-dev mailing list