Memory Leak caused by Socks5BytestreamManager hard references to XMPPConnection

First, thank you for the smack 4.1.2 update. The RosterGroup changes made fixed a very important memory leak for us.

After profiling with 4.1.2, I noticed another XMPPConnection memory leak. The Socks5BytestreamManager class declares a “managers” HashMap. These references prevent XMPPConnection objects from being collected. This map should probably also be a WeakHashMap.

Luckily I do not need SOCKS5 Bytstreams and I have been able to work around the issue by disabling the service, like so:


Thanks for reporting. I missed, while working on 295275e, that the ‘managers’ map is non-weak. Created SMACK-679, fixed with 7b and uploaded Smack 4.1.3-SNAPSHOT.

Please test and report back.

Thanks - That does the trick. There is no longer a leak with the weak map.