I’ve got a scenario that causes listeners registered with org.jivesoftware.smack.chat.Chat.addMessageListener() to get leaked.
I used the eclipse MAT with several java heapdumps to detect the issue. There is already a TODO in addMessageListener that warns of this as a potential issue.
It looks like that TODO has been around for awhile, and I’m interested in cleaning it up.
When I change “listeners” from a CopyOnWriteArraySet to Collections.newSetFromMap(new WeakHashMap()), my memory leak is cleared up, and there aren’t any obvious negative side effects.
I wanted to check with the community and see if there were any objections to accepting a merge with that change. I suppose it could cause some concurrency issues, but my tests have yet to reveal any.