Skip to content
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 #662

Closed
nannan111 opened this issue Jun 13, 2024 · 1 comment
Closed

OutOfMemoryError #662

nannan111 opened this issue Jun 13, 2024 · 1 comment

Comments

@nannan111
Copy link

UploadTask - (uploadId: 1) - error on attempt 1. Waiting 1s before next attempt.
java.lang.OutOfMemoryError: Failed to allocate a 314860912 byte allocation with 25165824 free bytes and 60MB until OOM, target footprint 364148440, growth limit 402653184
at okio.Buffer.readByteArray(Buffer.kt:1085)
at okio.Buffer.readByteArray(Buffer.kt:1080)
at okio.RealBufferedSource.readByteArray(RealBufferedSource.kt:241)
at okhttp3.ResponseBody.bytes(ResponseBody.kt:124)
at net.gotev.uploadservice.okhttp.OkHttpExtensionsKt.bodyBytes(OkHttpExtensions.kt:21)
at net.gotev.uploadservice.okhttp.OkHttpExtensionsKt.asServerResponse(OkHttpExtensions.kt:23)
at net.gotev.uploadservice.okhttp.OkHttpStackRequest.getResponse(OkHttpStackRequest.kt:95)
at net.gotev.uploadservice.HttpUploadTask.upload(HttpUploadTask.kt:50)
at net.gotev.uploadservice.UploadTask.run(UploadTask.kt:144)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:930)

@gotev
Copy link
Owner

gotev commented Jun 13, 2024

Your server is returning over 314MB of payload size as the upload response. That's causing the issue here, because the system is trying to allocate all that in RAM. The server should return a small payload to confirm the upload, possibly a JSON. The library is not designed to cover scenarios in which the server response payloads are huge.

@gotev gotev closed this as completed Jul 10, 2024
Repository owner locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants