Releasing a channel causes short-lived memory leak
When the channel is removed from the channel map as part of release(), a call to detach is also made. This call does not necessarily complete before the call to release() returns. The channel will also not be detached before it is removed from the channel map.
As part of the detach call, a timer is setup to wait for DETACHED to arrive, which never happens. The 10s timer waiting for the channel to detach keeps the channel from being garbage collected, and thus any listeners on the channel (and things they contain, aka the PublisherService in https://github.com/ably/ably-asset-tracking-android/issues/810) are leaked for a brief period of time.
This relates to the work in https://github.com/ably/ably-java/pull/914, but has probably always been a bug as even before those changes, the channel was removed from the map.
➤ Automation for Jira commented:
The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3343