OKHTTP Library bug causing memory leak

sudipto
The version of the OKHTTP library used inside the KiteAPi jar as a bug which you can check on the OKHTTP Github site...
https://github.com/square/okhttp/issues/5512

This bug means that the library opens up a couple of threads (OkHttp-Http2Connection and Okio-Watchdog) , which don't get shut even after the KiteConnection has been shut and logged out. This in turn causes the container to hold on to those threads even after the program has been shut. I have pasted a sample warning at the end of this message an example.

This bug has been fixed by the maintainers of the OKHTTP library (which you can check on the bug thread itself). It would be great if you guys could schedule an update of your library. This would help a lot in making our apps more stable without having to regularly reboot or kill zombie threads.

The web application [kite] appears to have started a thread named [OkHttp Http2Connection] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
[email protected]/jdk.internal.misc.Unsafe.park(Native Method)
[email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
[email protected]/java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:462)
[email protected]/java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361)
[email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
[email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
[email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
[email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[email protected]/java.lang.Thread.run(Thread.java:834)
Sign In or Register to comment.