Bug #6103

Possible memory leak in RosterElement

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Applicable version:
Source Code Disclaimer:


The current implementation of RosterElement keeps the instance of XMPPResourceConnection even though it is not needed anywhere and access to this variable is private.

Moreover, due to fact that roster is cached in XMPPSession it is possible that instance referenced in RosterElement is no longer needed as it was closed but cached entry is kept as other resource is online. Due to that, we may have in memory instances of XMPPResourceConnection which are no longer needed and should be garbage collected.

Associated revisions

Revision 8c1e375f (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

#6103: removed instance of XMPPResourceConnection from RosterElement


#2 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

  • Status changed from New to In QA
  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia
  • % Done changed from 0 to 100

I've found this during work on issue #6087.

As I reviewed code this instance is not needed anywhere, so I've removed it and modified RosterElement constructors to remove it.

I've updated source code so that our code will use new constructors. I've left parameter with XMPPResourceConnection in the method used for creation of RosterElement instances in case if someone would extend it and would like to have an instance of XMPPResourceConnection in his own implementation.

#3 Updated by Wojciech Kapcia TigaseTeam over 1 year ago

  • Status changed from In QA to Closed

Good catch - makes sense.

Also available in: Atom PDF