I'm trying to integrate web3j in an android application. But the library gives an Out Of Memory exception when loading the wallet file:
Credentials credentials = WalletUtils.loadCredentials("password", walletFile)
This is the exception:
java.lang.OutOfMemoryError: Failed to allocate a 268435468 byte allocation with 8050708 free bytes and 244MB until OOM
This seems to be the culprit:
//com.lambdaworks.crypto.SCrypt#scryptJ byte V = new byte[128 * r * N]; // r: 8, N: 262144, V = byte
I know that the credentials can be loaded because another project, Ether Wallet, uses web3j and is able to load the same wallet file. Can someone tell me how to solve this?