[External] : Re: Virtual thread memory leak because TrackingRootContainer keeps threads
robert engels
robaho at icloud.com
Wed Jul 10 14:52:15 UTC 2024
Understood. Just helping the OP with a solution that doesn’t require ephemeral threads.
> On Jul 10, 2024, at 8:15 AM, Ron Pressler <ron.pressler at oracle.com> wrote:
>
>
>
>> On 9 Jul 2024, at 17:11, robert engels <robaho at icloud.com> wrote:
>>
>> With a closable queue you can have natural synchronization so that all submitted items can be acked then any further reads will cause a “queue closed exception” causing the reader to terminate.
>>
>> It is very similar in design to an executor service.
>
> You are talking about something quite different from the subject of this discussion. You’re talking about a mechanism for *terminating* threads. The discussion is about collecting the effectively meaningless bytes of “effectively dead” *unterminated* threads. The only impact of that is on heap usage and observability, not on any functional thread behaviour. These two things are orthogonal.
>
> You may ask what the pros and cons of collecting “effectively dead” threads are, given that there is no functional difference whether you do or don’t, but I’ll leave that for a separate discussion.
>
> — Ron
More information about the loom-dev
mailing list