I have an issue where my client ultimately (over a course of a day) hangs with out of memory.
The cause is the frequent disconnects due to laptop being closed or just connection issues.
I do not use smack’s auto-reconnect in my code as it causes other problems.
I let go of the XMPPConnection and create a new one whenever I need to reconnect.
There’s a bug fix which looks like it may address the issue, but it hasn’t been touched in some time: