Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11593

Re: Not closing smack threads by disconnect (4.1.0-alpha1-SNAPSHOT)

$
0
0

Those executors are shut down in the finalize() method of the connection and PingManager. Now before anyone jumps in with "But finalizers are bad, you shouldn't use them", then rest assured that I'm well aware of the problematic of finalizers but I believe that this is actually a situation where they are useful (of course I'd be happy to be proven wrong or presented with a "better" design, feel free to join #smack to discuss this).

 

I think I don't have to explain that before the finalizer will be called, the connection instanced must become eligible for garbage collection. This should be the case when you drop the last reference to the instance. If there is still a strong reference path from a gc root to the instance, which can be determined/proved by inspecting a heap dump, then Smack has a memory leak which I'm happy to fix. But I've no indications that this is in-fact the case.

 

Also note that alpha6 is the latest alpha of Smack 4.1. I recommend using that version.


Viewing all articles
Browse latest Browse all 11593

Trending Articles