lrhkobe commented on issue #446: URL: https://github.com/apache/incubator-eventmesh/issues/446#issuecomment-882404842
The weak reference of `ClientGroupWrapper` in `Session.java` is designed to avoid circular reference. Because ClientGroupWrapper contains the reference of Session, and Session contains the reference of ClientGroupWrapper. You are right. When system GC occurs, weak references will be recycled, but if the strong reference of ClientGroupWrapper also exists, maybe it will not be a problem. We can find strong reference in the `clientGroupMap` field of `ClientSessionGroupMapping.java` : ``` private ConcurrentHashMap<String, ClientGroupWrapper> clientGroupMap; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
