OOM error on some devices due to larger files is fixed.#4
OOM error on some devices due to larger files is fixed.#4abayomiAkanji wants to merge 2 commits into
Conversation
The while loop algorithm changed to fix OOM crash in larger files.
Byte[] size of the overloaded "Encryption" & "Decryption" methods are reduced to fixed the OOM error.
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
=========================================
Coverage 96.35% 96.35%
Complexity 108 108
=========================================
Files 3 3
Lines 357 357
Branches 47 47
=========================================
Hits 344 344
Misses 6 6
Partials 7 7
Continue to review full report at Codecov.
|
|
It's odd that this change fixes an OOM error. Apps generally have +64MB of heap/ram/memory allotted and these file IO buffers are only 4kB. I could see how if you ran this in parallel on multiple files you might run into a problem, but the library isn't threadsafe anyway so you shouldn't do that. The only way I can see this throwing an OOM error is if you tried to load a large file into memory and use the byte array encrypt/decrypt routines. Changing the buffer sizes wouldn't help you there and instead give me the feeling that there's a different problem or memory leak happening. |
The encryption and decryption method throw OOM error for larger files on certain devices (Example is Samsung Galaxy J7, Samsung S5...). The while loop and byte[] are being modified to fix this bug.