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

Memory leak issue with ReplaySubject #85

Closed
jabeattie opened this issue Mar 29, 2021 · 1 comment · Fixed by #86
Closed

Memory leak issue with ReplaySubject #85

jabeattie opened this issue Mar 29, 2021 · 1 comment · Fixed by #86

Comments

@jabeattie
Copy link
Contributor

Hi Folks, we recently started using CombineExt in a project and it's already proven itself invaluable for fixing plenty of common scenarios we wanted to solve, so kudos for that.

We had a need to use share(replay:) recently and noticed after implementing it that we had some retain cycles appearing in our application. After spending some time looking into them, it looks to be caused by ReplaySubject not releasing its subscriptions when they receive a completion.

I've got an idea for a fix, but I'm not well versed enough on Combine yet to appreciate what the other implications of it may be, so any help would be appreciated, thanks.

@jabeattie
Copy link
Contributor Author

Some screenshots from the memory graph after using the share(replay:) operator

Screenshot 2021-03-29 at 07 51 22

Screenshot 2021-03-29 at 07 51 36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant