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

Brian S O'Neill bronee at gmail.com
Mon Jul 8 22:01:47 UTC 2024


The exact phrase in JEP 444 is, "Unlike platform thread stacks, virtual 
thread stacks are not GC roots."  GC roots also include static fields, 
but the tracked VT is only indirectly referenced by a static field, via 
a map object. So technically speaking, JEP 444 and JDK 21 are in agreement.

Also note that JEP 444 says, "...the [virtual] thread can be garbage 
collected"  It doesn't say that the virtual thread MUST be garbage 
collected.


On 2024-07-08 02:12 PM, Michal Domagala wrote:
> Hi
> 
> As a thread author, I would like to say I opened the thread because I 
> could not report a memory leak as a bug. Page 
> https://bugreport.java.com/bugreport/submit_start 
> <https://urldefense.com/v3/__https://bugreport.java.com/bugreport/submit_start__;!!ACWV5N9M2RV99hQ!O3-6Y8rB_Q3TnOXLeIa2WkhSm-X8hYgCkqwGAG4EqpVKaFgdKdh4kpH4juXWBBVbkBbMxFZDjRsTawE7Yeih$>  does not work.
> 
> In my understanding JEP 444 is finished and delivered in JDK 21. Any 
> deviation between JEP 444 and JDK 21 is a bug.
> I hoped somebody will say "OMG" and start fixing procedure. But it seems 
> to me discussion concerns on JEP 444 - good or bad decision was taken.
> 
> Personally, I have high confidence in the written word. Written word 
> convinced me that VT is GC'ed. It's very interesting to see other 
> opinions, but in my understanding the time is out of joint and seek for 
> help to set it right
> 


More information about the loom-dev mailing list