You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Darrel Schneider (Jira)" <ji...@apache.org> on 2021/05/27 20:38:00 UTC

[jira] [Updated] (GEODE-9331) ConnectionTable maintains WeakReference to thread local map for no reason

     [ https://issues.apache.org/jira/browse/GEODE-9331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darrel Schneider updated GEODE-9331:
------------------------------------
    Issue Type: Improvement  (was: Bug)

> ConnectionTable maintains WeakReference to thread local map for no reason
> -------------------------------------------------------------------------
>
>                 Key: GEODE-9331
>                 URL: https://issues.apache.org/jira/browse/GEODE-9331
>             Project: Geode
>          Issue Type: Improvement
>          Components: membership
>            Reporter: Darrel Schneider
>            Priority: Major
>
> Every time a p2p thread owned connection is created it is added to a HashMap kept by the thread in a ThreadLocal. A WeakReference referencing that HashMap is also added to an ArrayList. But this ArrayList is not actually used for anything. It is iterated over in ConnectionTable.close to close any of the thread local connections but all of these connections are also in the "threadConnectionMap" which is iterated over during close.
> So the ArrayList "threadConnMaps" can be removed with no loss of functionality. Getting rid of it will improve performance the first time a thread creates a thread owned connection and will reduce the amount of memory consumed (the ArrayList will have at least one entry for every thread using thread owned connections but it may have more since the WeakReference can be slow to be garbage collected). 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)