I started hitting OOM errors when migrating to 3.0...
# ktor
t
I started hitting OOM errors when migrating to 3.0.0-rc-1. Seems like the entire response is being loaded into memory before getting returned to the client when streaming.
1
I filed a youtrack here: https://youtrack.jetbrains.com/issue/KTOR-7461/respondOutputStream-reads-entire-contents-into-memory-before-returning-response Although it didn't let me set the affected version which should be 3.0.0-rc-1
b
This is likely due to SaveBodyPlugin becoming a default plugin https://api.ktor.io/ktor-client/ktor-client-core/io.ktor.client.plugins/-save-body-plugin.html
Seems like this feature could use some better safety rails though
a
In Ktor 2.*, the entire response body is also loaded into memory by default, except for when the body is explicitly streamed.
b
ah ok sounds like a problem with this mechanism
a
This problem is about the server 🙂
👌 1
👀 1
t
Just wanted to say, I tried out the fix this weekend and it's working great! Thanks for the fix
🙏 1