We(jitsi) recently upgraded to Smack 4.4.5 one of our components that was still using 4.2.
And we noticed some memory leaking of XMPP connections.
It happens because of the weak maps and the value (ServiceDisoveryManager) is holding a reference to the key (XMPPConnection).
I think you are right. The issue is not simply caused by obtaining a strong reference outside the lambda, but also due saving the action, which includes the lambda, in renewEntityCapsScheduledAction. And the lambda captures a strong reference to the connection, which in turn is strongly referenced by the action, which in turn we save in the renewEntityCapsScheduledAction field.
Well, I always consider multiple factors when to publish a new patch-level release. Users asking for it, is one factor.
I assume this is such a request and I am happy to prepare the 4.4.6 release. But first, I’d like to confirm that the proposed fix solves the issue. Could you graph the next nightly build of 4.4.6-SNAPSHOT to test and confirm whether or not the issue is resolved?
No, ignore. I was on the wrong branch and I’m not able to build manually the 4.4 one because of the IqProvider thingy. I will wait for the SNAPSHOTs to be released.
Caused by: java.net.URISyntaxException: Expected authority at index 8: https://
at java.base/java.net.URI$Parser.fail(URI.java:2915)
at java.base/java.net.URI$Parser.failExpecting(URI.java:2921)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3165)
at java.base/java.net.URI$Parser.parse(URI.java:3116)
at java.base/java.net.URI.<init>(URI.java:600)
at org.jivesoftware.smack.bosh.BOSHConfiguration.getURI(BOSHConfiguration.java:81)
at org.jivesoftware.smack.bosh.XMPPBOSHConnection.connectInternal(XMPPBOSHConnection.java:155)
Thanks for the quick fix.
I confirm that the leak is fixed.
I tested with TCP and with Bosh XMPP connection that I reproduce it with 4.4.5 and I do not reproduce it with the latest snapshot 4.4.6-20220526.182902-3.