Does ThreadLocal automatically clear values created for already finished threads?
Yes, the variables are made available for Garbage collections but only if there are no other references to those values (held by some other thread). But when you say a thread is finished, it shouldn't be like a pooled threads. Pooled threads should clear their own variables before they are put back to pool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With