[jira] [Created] (IGNITE-2513) Review ThreadLocal.remove() usages.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-2513) Review ThreadLocal.remove() usages.

Anton Vinogradov (Jira)
Vladimir Ozerov created IGNITE-2513:
---------------------------------------

             Summary: Review ThreadLocal.remove() usages.
                 Key: IGNITE-2513
                 URL: https://issues.apache.org/jira/browse/IGNITE-2513
             Project: Ignite
          Issue Type: Sub-task
          Components: general
    Affects Versions: 1.5.0.final
            Reporter: Vladimir Ozerov
            Assignee: Vladimir Ozerov
            Priority: Critical
             Fix For: 1.6


*Problem*
We have lots scenarios when TL.set(...) is accompanied with TL.remove(). Once TL entry is removed, next set(...) invocation will cause creation of new inner entries, thus generating garbage.

*Solution*
Use TL.set(null) instead of TL.remove().
*CAUTION!* This applies only to static TLs and TLs on rarely created objects (e.g. contexts). This optimization should not be applied to non-static TLs of frequently created objects because it will lead to excessive grow of internal TL map.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)