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: https://github.com/JetBrains/kotlin-native/points/3595
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?
Instance:
@Throws(Exception::class)
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.