Environment:
- Drift version: 0.3.6
- Platform: Android
- Device: Pixel 4
- OS: Android 13
Description:
The app crashes when attempting to open a large file. The crash appears to be caused by excessive memory allocation during file processing, leading to an OutOfMemoryError.
Steps to Reproduce:
- Launch the app
- Attempt to open a large file (size not precisely measured, but large enough to trigger memory issue)
- Observe crash
Expected Behavior:
The app should handle large files gracefully (e.g., streaming, chunking, or rejecting with a clear error), without crashing.
Actual Behavior:
The app crashes with OutOfMemoryError.
Crash Log:
05-02 09:28:29.439 8811 8811 D AndroidRuntime: Shutting down VM
05-02 09:28:29.440 8811 8811 E AndroidRuntime: FATAL EXCEPTION: main
05-02 09:28:29.440 8811 8811 E AndroidRuntime: Process: com.example.drift, PID: 8811
05-02 09:28:29.440 8811 8811 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 205235072 byte allocation with 60879216 free bytes and 58MB until OOM, target footprint 268435456, growth limit 268435456
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at java.util.Arrays.copyOf(Arrays.java:3670)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:120)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:95)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:137)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at p0.o.k(SourceFile:462)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.j.k(SourceFile:147)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at p0.o.k(SourceFile:334)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.j.k(SourceFile:147)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.j.k(SourceFile:110)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at p0.o.k(SourceFile:334)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.j.k(SourceFile:147)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at p0.o.k(SourceFile:334)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.j.k(SourceFile:147)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at p0.o.a(SourceFile:10)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at M.Q.n(SourceFile:22)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.b.z(SourceFile:105)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at c0.c.a(SourceFile:7)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at e0.f.onActivityResult(SourceFile:68)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:8613)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:5340)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:5386)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7898)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-02 09:28:29.440 8811 8811 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
05-02 09:28:30.160 5732 5732 I AndroidRuntime: VM exiting with result code 0.
Video:
https://github.com/user-attachments/assets/22d9559a-5241-41ed-ae8a-81099e1f0c84
Environment:
Description:
The app crashes when attempting to open a large file. The crash appears to be caused by excessive memory allocation during file processing, leading to an
OutOfMemoryError.Steps to Reproduce:
Expected Behavior:
The app should handle large files gracefully (e.g., streaming, chunking, or rejecting with a clear error), without crashing.
Actual Behavior:
The app crashes with
OutOfMemoryError.Crash Log:
Video:
https://github.com/user-attachments/assets/22d9559a-5241-41ed-ae8a-81099e1f0c84