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

🐛 Bug Report: Storage getFileDownload fails for big file (1GB) due to OutOfMemoryError #44

Open
2 tasks done
joern-h opened this issue Oct 11, 2023 · 0 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@joern-h
Copy link

joern-h commented Oct 11, 2023

👟 Reproduction steps

Download a big file (1GB) with getFileDownload

👍 Expected behavior

It should download the file.

There is a client.chunkedUpload i guess we also need a client.chunkedDownload

👎 Actual Behavior

Throws java.lang.OutOfMemoryError:

AndroidRuntime  E  FATAL EXCEPTION: OkHttp Dispatcher
                E  java.lang.OutOfMemoryError: Failed to allocate a 268435472 byte allocation with 6275072 free bytes and 124MB until OOM, target footprint 143753320, growth limit 268435456
                E      at java.util.Arrays.copyOf(Arrays.java:3161)
                E      at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
                E      at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
                E      at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
                E      at kotlin.io.ByteStreamsKt.copyTo(IOStreams.kt:108)
                E      at kotlin.io.ByteStreamsKt.copyTo$default(IOStreams.kt:103)
                E      at kotlin.io.ByteStreamsKt.readBytes(IOStreams.kt:136)
                E      at io.appwrite.Client$awaitResponse$2$1.onResponse(Client.kt:511)
                E      at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
                E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                E      at java.lang.Thread.run(Thread.java:919)

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Linux

🧱 Your Environment

Appwrite 1.4.5
sdk-for-android:4.0.0

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants