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

Barry Oglesby commented on GEODE-6287:
--------------------------------------

I made a change to FilterProfile.cleanupForClient to also clean up the 
clientMap. That addressed the leak.

Now with 15000 client connects/registerInterests/disconnects:
{noformat}
 num #instances #bytes class name
----------------------------------------------
 1: 29928 2706856 [C
 2: 7472 840576 java.lang.Class
 3: 29822 715728 java.lang.String
 4: 1607 478240 [B
 5: 5946 445008 [Ljava.lang.Object;
 6: 773 410136 [J
 7: 11820 378240 java.util.concurrent.ConcurrentHashMap$Node
 8: 2980 262240 java.lang.reflect.Method
 9: 7953 254496 java.util.HashMap$Node
 10: 4911 208984 [I
 11: 2138 198408 [Ljava.util.HashMap$Node;
 12: 10827 173232 java.lang.Object
 13: 2119 169520 java.lang.reflect.Constructor
 14: 4120 164800 java.util.LinkedHashMap$Entry
 15: 1726 96656 java.util.LinkedHashMap
Total 175924 9348120
{noformat}

> When a client connects, registers interest and disconnects normally, its 
> ClientProxyMembershipID is not cleaned up and a memory leak occurs
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-6287
>                 URL: https://issues.apache.org/jira/browse/GEODE-6287
>             Project: Geode
>          Issue Type: Bug
>          Components: client queues, client/server
>            Reporter: Barry Oglesby
>            Assignee: Barry Oglesby
>            Priority: Major
>
> When a client connects to a distributed system and registers interest, the 
> Region's FilterProfile's clientMap (an IDMap) registers the 
> ClientProxyMembershipID in both the realIDs and wireIDs like:
> {noformat}
> realIDs={identity(192.168.2.12(client-register:52879:loner):63013:2327c553:client-register,connection=2=1};
> wireIDs={1=identity(192.168.2.12(client-register:52879:loner):63013:2327c553:client-register,connection=2}
> {noformat}
> When the client leaves normally, the UnregisterInterest command is invoked 
> which removes the interest and the region. Part of that behavior is to remove 
> the regionName from the set of regions.
> {noformat}
> this.regions.remove(regionName)
> {noformat}
> Then ClientInterestList.clearClientInterestList is then invoked which is 
> supposed to clear the FilterProfile for each region, but the regions are 
> already cleared by the UnregisterInterest command, so this method doesn't do 
> anything.
> Then, LocalRegion.cleanupForClient is invoked which invokes 
> FilterProfile.cleanupForClient. This method currently only closes CQs (which 
> also cleans up the cqMap which is also an IDMap like the clientMap).
> At the end of this, the clientMap's realIDs and wireIDs still contain the 
> ClientProxyMembershipID.
> The cleanupForClient method could be changed to also clean up the clientMap.
> Note: If the client is killed abnormally, the UnregisterInterest command is 
> not invoked, so the interest and the region is not cleaned up normally. When 
> ClientInterestList.clearClientInterestList is called, the set of regions 
> still contains the region, and the IDMap is cleaned up properly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to