Absurd number of threads while connecting disconnecting websocket
Crash report attached from a user's phone and there were 614 threads at the time of crash.
I tried reproducing the error and it doesn't crash but I do see a lot threads being created while I connect and disconnect from network. Every time call.enqueue(webSocketListener) is hit, two new threads are being created which are never destroyed.
Thread Name: OkHttp Connecti OkHttp Dispatch
Maybe I am doing something wrong, should I be destroying something while disconnecting?
com.sense.androidclient_issue_73_crash_57c0785e004400012dab6aef5b38d9eb.txt
Yeah, you’re creating too many instances of OkHttpClient. This doc explains what you should do: https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html
@swankjesse Should this issue be closed then?