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

Fix memory leaks by invalidating session after cancelling tasks #209

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

pauluhn
Copy link
Contributor

@pauluhn pauluhn commented Jan 25, 2021

Mojio team noticed memory leaks within the networking layer with netfox integrated for debugging purposes. After this fix, we no longer see the memory leaks.

You can test this by looking at the memory graph before/after this fix.

Also, from the URLSession documentation:

Important
The session object keeps a strong reference to the delegate until your app exits or explicitly invalidates the session. If you don’t invalidate the session, your app leaks memory until the app terminates.

@ljoraanstad
Copy link

+1, I also found this issue to be present when performing an action that begins a series of many network requests. Eventually the requests would get bogged down and start to run into weird issues with timeouts, etc. until you eventually aren't able to launch the app.

@vGubriienko vGubriienko changed the base branch from master to develop December 11, 2021 16:09
@vGubriienko vGubriienko merged commit 3656b7f into kasketis:develop Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants