-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutOfMemoryError: Failed to allocate a 8208 byte allocation with 3418760 free byte #1068
Comments
Can we get a reproducer of some sorts? |
What do you mean? You can reproduce the problem by running the demo I have deleted irrelevant content |
Thanks for the repro @liangjingkanji |
I think this method returns wrong result ChuckerInterceptor will try to parse the binary, For example |
Yup that could be the reason. |
It also fails if I upload the InputStream, Because the ChuckerInterceptor attempt will cause call fun InputStream.toRequestBody(
contentType: MediaType? = MediaConst.OCTET_STREAM,
contentLength: Long? = null
): RequestBody {
return object : RequestBody() {
override fun contentType() = contentType
val availableLength: Long by lazy {
if (contentLength != null) return@lazy contentLength
val availableLength = available()
if (availableLength == 0) -1L else availableLength.toLong()
}
override fun contentLength(): Long {
return availableLength
}
override fun writeTo(sink: BufferedSink) {
source().use { source ->
sink.writeAll(source)
}
}
}
} |
@liangjingkanji is this somethign you'll be up for attempting to fix? |
Ok, I'll attempting to fix this |
✍️ Describe the bug
Downloading large files (over 150mb) crashes, I'm sure it's Chucker's problem
Exception
Use
💣 Steps to reproduce
🔧 Expected behavior
Do not crash when downloading large files
📷 Screenshots
📱 Tech info
📄 Additional context
I've recommended your project to others a long time ago
The text was updated successfully, but these errors were encountered: