ios – Kotlin multiplatform: GC doesn’t launch reminiscence – how one can drive it to launch?


I’m growing a community extension on iOS and I wish to use KMM to share some code between Android and iOS.

iOS is kind of strict on RAM utilization and it solely supplies 50 MB for community extensions. KMM doesn’t launch reminiscence typically/quickly sufficient and iOS kills my app.

The issue appears to be the identical as on this difficulty on github:

I’ve tried calling GC.accumulate() nevertheless it doesn’t appear to be accessible anymore.

Any options? Can I take advantage of KMM in low RAM environments?


  enjoyable decodeJson(json: String) {
      val decodedJson = Json{ ignoreUnknownKeys = true }.decodeFromString<Json>(json)

Despite the fact that decodedJson just isn’t referenced wherever, KMM doesn’t launch the reminiscence.


Please enter your comment!
Please enter your name here