I am having an issue with the Kotlin GC taking an excessive amount of time on iOS, hanging the app. I am using Ktor, Compose MP and have a lot of objects flying around the system. See thread for an Intruments example.
tylerwilson
04/03/2024, 2:06 PM
You see it hangs up at 200% CPU for 18(!) seconds.
tylerwilson
04/03/2024, 2:07 PM
For this reason, I added this to my gradle.properties:
Copy code
kotlin.native.binary.objcDisposeOnMain = false
which fixes that, but according to others, that may cause leaks with iOS resources. And I do see over time that the app runs out of memory, starts lagging and then will eventually quit.
tylerwilson
04/03/2024, 2:08 PM
Are there any other solutions, like an alternate GC implementation???
tylerwilson
04/04/2024, 5:03 PM
Please help! We are hoping to get this new version out by the end of month, and would like the iOS experience to be as smooth as Android. Thanks!
tylerwilson
04/04/2024, 5:04 PM
I did change to the mimalloc version with this flag:
Copy code
kotlin.native.binary.mimallocUseCompaction = true
added. And it does seem a little better overall. But I expect we will continue to have leaks since I still have the objcDisposeOnMain set to false.