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鈥檒l 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