Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-9331

ConnectionTable maintains WeakReference to thread local map for no reason

    XMLWordPrintableJSON

Details

    Description

      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). 

      Attachments

        Activity

          People

            dschneider Darrel Schneider
            dschneider Darrel Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: