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

java.lang.OutOfMemoryError: Could not allocate JNI Env #6283

Closed
2 tasks done
Trolldemorted opened this issue Feb 22, 2017 · 4 comments
Closed
2 tasks done

java.lang.OutOfMemoryError: Could not allocate JNI Env #6283

Trolldemorted opened this issue Feb 22, 2017 · 4 comments
Labels

Comments

@Trolldemorted
Copy link
Contributor

Trolldemorted commented Feb 22, 2017

I have:


Bug description

Out of the blue, signal crashed.

02-21 12:26:42.279  2235  3222 E AndroidRuntime: java.lang.OutOfMemoryError: Could not allocate JNI Env
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at java.lang.Thread.nativeCreate(Native Method)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at java.lang.Thread.start(Thread.java:1063)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.ConnectionPool.put(ConnectionPool.java:134)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.OkHttpClient$1.put(OkHttpClient.java:152)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:191)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:132)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:101)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at okhttp3.RealCall.execute(RealCall.java:63)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.whispersystems.signalservice.internal.push.PushServiceSocket.getConnection(PushServiceSocket.java:655)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeRequest(PushServiceSocket.java:529)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.whispersystems.signalservice.internal.push.PushServiceSocket.getMessages(PushServiceSocket.java:223)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.whispersystems.signalservice.api.SignalServiceMessageReceiver.retrieveMessages(SignalServiceMessageReceiver.java:143)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob.onRun(PushNotificationReceiveJob.java:36)
02-21 12:26:42.279  2235  3222 E AndroidRuntime: 	at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
02-21 12:26:42.279 2235 3222 E AndroidRuntime: at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)

Pretty sure this is not related to my build, and the device had (after the crash) ~1.5GB free ram. An issue on so linked this error messages to leaked file descriptors, which is apparently intended in libsignal. The libsignal version i use has fixed that issue, but maybe there are other leaked FDs?

Steps to reproduce

  • cannot (yet) reproduce, happened only once

Device info

Device: Xiaomi Redmi Note 3 Pro
Android version: 6.0.1
Signal version: 3.29.6 + Trolldemorted@cdb8ac2

Link to debug log

https://gist.github.com/anonymous/51447caee0494fef9bb45994cd4fada3

@Trolldemorted
Copy link
Contributor Author

It has happened again, but on a different device and with a different user and with an unmodified signal:

https://gist.github.com/anonymous/b4bf8bb05611b0c42a75aaac8ae130d6

Nothing extraordinary happened, except that the device received a lot of receipts before it crashed.

Trolldemorted added a commit to Trolldemorted/libsignal-service-java that referenced this issue May 11, 2017
New OkHttpClients came with their own thread and connection pools. With newBuilder() we can create a new client with an already existing pool.

Fixes signalapp/Signal-Android#6283
@Trolldemorted
Copy link
Contributor Author

i think i found the culprit!

signalapp/libsignal-service-java#40

@Trolldemorted
Copy link
Contributor Author

was this fixed by signalapp/libsignal-service-java@0557122?

@automated-signal
Copy link

GitHub Issue Cleanup:
See #7598 for more information.

@signalapp signalapp locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants