@Brian G You may want to subscribe to this issue which proposes bringing streaming (de)serialization support to platforms other than JVM. Key characteristic of streamed handling being reduced peak memory load.
b
Brian Guertin
01/19/2022, 11:49 PM
Hmm, would that even help though? My data is not large, only a few kilobytes. I suspect it's more about the nesting or something. Even only 5 fields deep in the JSON, kotlinx.serialization's stack is like 700 calls deep.
The thing that has me scratching my head the most, is that when Ktor calls the json deserializer, it works fine, but If I call the same deserializer in my code, I get this error. Regardless of if I use main thread or worker thread.