上游 · Kotlin/Native memory management
If you encounter problems with CMS, switch back to the parallel mark concurrent sweep (PMCS) setup. To do that, set the following binary option in your gradle.properties file:
kotlin.native.binary.gc=pmcs
Enable garbage collection manually
To force-start the garbage collector, call kotlin.native.internal.GC.collect() . This method triggers a new collection and waits for its completion.
Monitor GC performance…