Continuing from the previous example, do note that each thread will hold an implicit reference to its copy of a thread-local variable. It will keep holding as long as the thread is alive and the ThreadLocal instance is accessible; When a thread is killed, all of its copies of thread-local instances are subject to garbage collection.
(more…)