-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Crashes on OutOfMemoryError, while there are 257 "OkHttp ConnectionPool" threads #2846
Comments
You want to read this advice: |
Thanks for the quick reply. |
@marmor7 Do you mean to say if we use
Reference: Websocket.java for engine.io-client-java project. |
@shobhitpuri yes, that's exactly what we did, and had ton of memory issues. From the docs:
Instead, we now have a single OkHttpClient that we build once, and is used by all methods. |
https://stackdev.space/questions/java-the-memory-has-run-out-error There it is—the answer |
We've recently migrated our app to OkHttp, and we've now getting several crashes for out-of-memory related errors.
Looking at the crashes we see hundreds of threads running at:
okhttp3.ConnectionPool$1.run (ConnectionPool.java:66)
The stack of the crash itself is:
Shouldn't there be a limit on how many threads can OkHttp create?
The text was updated successfully, but these errors were encountered: