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

OutOfMemoryError BouncyCastleProvider.addAlgorithm #55

Open
crescent7272 opened this issue Jan 7, 2021 · 0 comments
Open

OutOfMemoryError BouncyCastleProvider.addAlgorithm #55

crescent7272 opened this issue Jan 7, 2021 · 0 comments

Comments

@crescent7272
Copy link

crescent7272 commented Jan 7, 2021

I have an OOM problem. This is the stacktrace on Firebase Crashlytics.

Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 16396 byte allocation with 2088 free bytes and 2088B until OOM
       at java.util.Hashtable.makeTable(Hashtable.java:487)
       at java.util.Hashtable.doubleCapacity(Hashtable.java:507)
       at java.util.Hashtable.put(Hashtable.java:380)
       at java.security.Provider.put(Provider.java:264)
       at org.spongycastle.jce.provider.BouncyCastleProvider.addAlgorithm(BouncyCastleProvider.java)
       at org.spongycastle.jce.provider.BouncyCastleProvider.addAlgorithm(BouncyCastleProvider.java)
       at org.spongycastle.jcajce.provider.symmetric.DSTU7624$Mappings.configure(DSTU7624.java)
       at org.spongycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(BouncyCastleProvider.java)
       at org.spongycastle.jce.provider.BouncyCastleProvider.setup(BouncyCastleProvider.java)
       at org.spongycastle.jce.provider.BouncyCastleProvider.access$000(BouncyCastleProvider.java)
       at org.spongycastle.jce.provider.BouncyCastleProvider$1.run(BouncyCastleProvider.java)
       at java.security.AccessController.doPrivileged(AccessController.java:45)
       at org.spongycastle.jce.provider.BouncyCastleProvider.<init>(BouncyCastleProvider.java)
       at br.com.***.library.securemobiletoken.TokenUtils.<init>(TokenUtils.java)
       at br.com.***.library.securemobiletoken.SecureMobileToken.<init>(SecureMobileToken.java)
       at br.com.***.***.MainActivity.configureSMT(MainActivity.java)
       at br.com.***.***.MainActivity.onCreate(MainActivity.java)
       at android.app.Activity.performCreate(Activity.java:6609)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3113)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3275)
       at android.app.ActivityThread.access$1000(ActivityThread.java:218)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1744)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:7007)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Probably in our library this line causes the error, but I guess nothing wrong with this that could cause OOM exception.

public TokenUtils() {
        Security.addProvider(new BouncyCastleProvider());
    }

The issue is captured on a device that has android 5.1.1, samsung, Galaxy J3(2016)
Orientation: Portrait
Free space in RAM: 322.4 MB
Free disk space: 1.63 GB

Thanks in advance.

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

1 participant