Unable to handle large 500 MB files
When I zip a file and share it and try to save it using this app, and it's about 500MB or more, then it never works. This is true for version 1.2.1, but I haven't tried the most recent version.
Okay, I just tried it for version 1.2.2 and the issue persists. What exactly happens is that the app seems to crash and then it saves a zip that is showing up as zero bytes, even though it should be close to 400 megabytes. And then when I try to open that .zip, it just says couldn't extract file.
Hi, honestly the app is mostly intended to be used with smaller files, but from your descritpion I can think of a few possibilities.
It could be that the way I am saving the file hits some file size restriction, although it's a bit unlikely I believe I should take a look into it anyway. The possibility that I think is a bit more likely is that the saving process is taking too long and soemthing (likely the system itself) is killing the copy process. This is expected because, as I only been testing with small files, I never properly implemented asynchronous handling of the saving.
So, I believe what I can do to fix this is something I should have done a long time ago: move the saving to a separate and have a notification both to keep the background progress of the file saving active as well showing progressing.
If that doesn't fix it then at the very least it will be a UX improvement (but it should fix it, your symptoms point to this exact issue I mentioned above)
@MikeStirner
Hi, sorry for the delay, I have been busy with some personal stuff.
I did investigate this today and after testing I did find the culprit (it was me actually). This is the error message:
java.lang.OutOfMemoryError: Failed to allocate a 798568312 byte allocation with 6291456 free bytes and 250MB until OOM, target footprint 11660280, growth limit 268435456
The problem is that I was creating a buffer to read the data from the original file and write to the new one. The buffer was going to be used to split the data in chunks, but I accidentally had set it to always use the entire size of the file. This means it tried to load the entire file into memory and if the file was too big it hit a limit on how much memory the app could use.
Since I mostly tested on small files, I didn't notice it before. I will send a fix shortly which basically relies on using a 1 MB buffer and that should completely fix it.
Thanks so much! Way to go! Looking forward to trying it out!
The code is done, I will create a release (which will eventually be grabbed by F-Droid) and publish to Google Play soon. I am not sure if I will do it today but I hope to do so no later than by the end of Friday.