RNCryptorNative icon indicating copy to clipboard operation
RNCryptorNative copied to clipboard

File cryptor OOM

Open WMariusz opened this issue 9 years ago • 0 comments

When i encrypt and decrypt large image file (14M jpg image) to app i receive OutOfMemory exception.

java.lang.OutOfMemoryError: Failed to allocate a 49962864 byte allocation with 10213504 free bytes and 9MB until OOM at java.lang.StringFactory.newStringFromChars(Native Method) at java.lang.StringFactory.newStringFromChars(StringFactory.java:218) at java.lang.StringFactory.newStringFromBytes(StringFactory.java:203) at java.lang.StringFactory.newStringFromBytes(StringFactory.java:53) at java.lang.StringFactory.newStringFromBytes(StringFactory.java:45) at tgio.rncryptor.RNCryptorNative.decryptFile(RNCryptorNative.java:114) at pl.edicom.jncr.cryptor.NativeCryptor.decryptFile(NativeCryptor.kt:33)

On JNCryptor library there was AES256JNCryptorOutputStream and AES256JNCryptorInputStream that helped me to rewrite file with buffer. I tried find any solution in C implementation but i found non.

ps. thanks for add file support 👍

WMariusz avatar May 30 '16 08:05 WMariusz