-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
iOS Memory Leak when KTOR Get Request is Made #1420
Comments
… indicate the session is finished (ktorio#1420)
I spent some time over the last few days digging into this issue, and believe I have found the issue (and solved it). BackgroundWe made a sample app that simply makes 300 API calls in quick succession in order to (roughly) test Ktor's performance and memory profile. As it stands today (with Ktor 1.3.0-beta-2), the memory profile looks something like this, with the peak of the graph being roughly 122MB: Looking at what is leaking, it appears as though the biggest source is a large number of 96KB mallocs in After looking through the call traces for these allocations, it appears as though the entire coroutine used for making the request was leaked, and these objects just happened to be the biggest single object connected to that leak. The fixKtor's iOS client engine currently opens an
After forking These allocations appear to be properly collected now, and no longer leak. PR #1480 contains this fix. |
… indicate the session is finished (#1420)
Fixed in |
Hello, I am having an issue with iOS memory leaks when I make a ktor get request.
The dispatcher is being built on the iosX64/iosArm32/iosArm32 side through an class implementing CoroutineDispatcher() with the override fun dispatch doing
The text was updated successfully, but these errors were encountered: