Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing a channel causes short-lived memory leak #919

Open
AndyTWF opened this issue Feb 14, 2023 · 1 comment
Open

Releasing a channel causes short-lived memory leak #919

AndyTWF opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@AndyTWF
Copy link
Contributor

AndyTWF commented Feb 14, 2023

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 ably/ably-asset-tracking-android#810) are leaked for a brief period of time.

This relates to the work in #914, but has probably always been a bug as even before those changes, the channel was removed from the map.

┆Issue is synchronized with this Jira Task by Unito

@AndyTWF AndyTWF added the bug Something isn't working. It's clear that this does need to be fixed. label Feb 14, 2023
@sync-by-unito
Copy link

sync-by-unito bot commented Feb 14, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3343

@AndyTWF AndyTWF changed the title Releasing a channel causes long-lived timer and memory leak Releasing a channel causes short-lived memory leak Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

No branches or pull requests

1 participant