ThreadLocal Internals: How It Works, Why It Leaks, and Safe Usage Patterns
ThreadLocal provides per-thread variable copies via a ThreadLocalMap with weak-reference keys and strong-reference values, enabling request-context storage and non-thread-safe object reuse, but risks memory leaks in long-lived thread pools unless explicitly removed, and requires careful handling for cross-thread propagation.
