RecentlyOutOfMemoryError exceptions occurred when receiving high amount of PusherBeams notifications in our app.
Fatal Exception: java.lang.OutOfMemoryError: Could not allocate JNI Env
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:730)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:941)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1359)
at okhttp3.ConnectionPool.put(ConnectionPool.java:153)
at okhttp3.OkHttpClient$1.put(OkHttpClient.java:167)
...
at com.pusher.pushnotifications.api.PusherLibraryHeaderInterceptor.intercept(PusherLibraryHeaderInterceptor.kt:13)
...
According to this stackoverflow post each new okHttpClient has his own connection pool.
By instantiating only one instance of the client future request add up in the same connection pool and runs memory efficient.
Recently
OutOfMemoryError
exceptions occurred when receiving high amount of PusherBeams notifications in our app.According to this stackoverflow post each new okHttpClient has his own connection pool.
By instantiating only one instance of the client future request add up in the same connection pool and runs memory efficient.