Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting OOM on encryptShared method in android SDK #67

Open
tizisdeepan opened this issue Dec 11, 2023 · 1 comment
Open

Getting OOM on encryptShared method in android SDK #67

tizisdeepan opened this issue Dec 11, 2023 · 1 comment

Comments

@tizisdeepan
Copy link

Description and steps to reproduce
When trying to encrypt multiple files that are fairly large - around 60MB each, the SDK returns an OOM

2023-12-11T06:43:34.658000+00:00 global.spectrum.connect: 6576:21388 W/System.err: java.lang.OutOfMemoryError: Failed to allocate a 92143632 byte allocation with 24744056 free bytes and 23MB until OOM, target footprint 268435456, growth limit 268435456
2023-12-11T06:43:34.658000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at java.util.Arrays.copyOf(Arrays.java:3578)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.android.common.worker.StreamsEncryptWorker.encryptShared$ethree_common_release(StreamsEncryptWorker.kt:48)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.android.common.EThreeCore.encryptShared(EThreeCore.kt:20)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at z3.g.i(FileEncryption.kt:109)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:120)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:95)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:156)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at java.io.OutputStream.write(OutputStream.java:127)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21438 I/Card: Signature 'self' has no additional data
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.sdk.crypto.VirgilCrypto.processEncryption(VirgilCrypto.java:21)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.sdk.crypto.VirgilCrypto.encrypt(VirgilCrypto.java:24)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.sdk.crypto.VirgilCrypto.authEncrypt(VirgilCrypto.java:8)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.sdk.crypto.VirgilCrypto.authEncrypt(VirgilCrypto.java:5)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.android.common.worker.StreamsEncryptWorker.encryptShared$ethree_common_release(StreamsEncryptWorker.kt:48)
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21438 I/Card: Signature 'virgil' has no additional data
2023-12-11T06:43:34.659000+00:00 global.spectrum.connect: 6576:21388 W/System.err: at com.virgilsecurity.android.common.EThreeCore.encryptShared(EThreeCore.kt:20)

Expected behavior
OOM should not be returned and all files should be encrypted successfully one by one

Platform (please complete the following information):

  • Device: Google Pixel 4a
  • OS: Android 13
  • E3Kit Version 2.0.10
@Scratch-net
Copy link

@tizisdeepan could you please share your encryption code?
Also, how many files does it process before throwing OOM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants