Closed c-mendoza closed 5 years ago
Also, the issue does not show up in Dio 2.0.4
Downloading large files should use dio.download()
instead of download2()
, because download2()
will save the whole file content in RAM before the file downloading end, which may exhaust heap space.
Good to know, closing the issue, thanks.
I'm using dio.download() and the app crashes downloading about 25% of a 300MB file.
dio.download( link, filePath, onReceiveProgress: showDownloadProgress, deleteOnError: true, cancelToken: cancelToken, )
OutOfMemory error loading stream E/LoadTask(15348): java.lang.OutOfMemoryError: Failed to allocate a 65552 byte allocation with 64672 free bytes and 63KB until OOM, target footprint 536870912, growth limit 536870912
Issue Info
Issue Description and Steps
Dio crashes any app that downloads large files using
Dio.get
. TheDio.download
method works. I'm currently trying to download a ~350MB file and it consistently crashes at ~78% download completion.It is reproducible using your download example, just use the
download2(...)
method and point it to a large enough file.The crash never produces a stack trace while testing on my hardware, but the simulator outputs many of these errors before crashing: