[ 
https://issues.apache.org/jira/browse/GEODE-9331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17359685#comment-17359685
 ] 

ASF subversion and git services commented on GEODE-9331:
--------------------------------------------------------

Commit b6572238a02f6bc3ead9c5f5738065593d362320 in geode's branch 
refs/heads/support/1.12 from Darrel Schneider
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=b657223 ]

GEODE-9331: remove the threadConnMaps ArrayList (#6535)

Removed the threadConnMaps ArrayList.
This removal also means that the HashMap is now
only referenced by a ThreadLocal so it no longer
is synchronized which simplified the code.

(cherry picked from commit 88918f1221e7bf90c88596d19c06ec41eec8315e)


> 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
>            Assignee: Darrel Schneider
>            Priority: Major
>              Labels: GeodeOperationAPI, pull-request-available
>             Fix For: 1.12.3, 1.13.3, 1.14.0, 1.15.0
>
>
> 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)

Reply via email to