Carlos
02/11/2025, 2:35 AMstd::__1::invoke_result<kotlin::gc::ConcurrentMarkAndSweep...
kotlin::gc::mark::ParallelMark::parallelMark(kotlin::ParallelProcessor...
Kotlin_processObjectInMark
Kotlin_processArrayInMark
I see the memory usage spike, and the app is stuck until the GC finishes scanning. On Kotlin 1.9 the app is super smooth.
One code change we made was removing explicit freeze()
calls in a small Flow wrapper. For example, we used to do:
@OptIn(FreezingIsDeprecated::class)
class FlowWrapper<out T>(...) {
init { freeze() }
...
}
That’s gone because freeze is deprecated under the newer memory model. But I’m wondering if that might affect how large object graphs are pinned or scanned.
Has anyone run into big GC stalls on iOS with Kotlin 2.x? If so, how did you handle it? Any help or tips would be awesome. Thanks!
Slack Conversation