Closed gomezgoiri closed 8 years ago
You are probably correct. The PR for gzip compression (#32) started to address this issue by adjusting the thread pool handling, but based on a cursory look still doesn't seem to fully expose it via an API which is probably the best fix. I can't really speak to common practice for Jetty, but given how HttpClient is positioned, particularly with the thread setup, I suspect that yes sharing an instance is common, but as stated we probably need to expose the thread setup to the user. I can't give a timeframe on when I'll be able to get to this but if you want to take a stab and submit a pull request it will at least get the ball rolling.
Hi Brian, thanks for letting me know. The code sent for the issue 44 definitely looks like a solution for this problem. I will use it and test it ASAP.
P.S.: Sorry for not attending you first request, I had it marked as a TODO but I never found the moment.
The problem described in this issue can be fixed now thanks to the new RemoteLRS.destroy method. For more info see #50.
Many thanks @brianjmiller.
Since I started using this library I have experienced some memory leaks in Tomcat 7.
When I redeploy the webapp I see some messages like the following:
After checking TinCanJava, I see that you use Jetty to make HTTP requests. There is a suspicious static private attribute in RemoteLRS of the HttpClient class.
Is sharing a unique HttpClient object a common practice for Jetty? Can this be related to the memory leak?
I also see that httpClient.stop() is not called anywhere in RemoteLRS. Would not be a good idea to add a method to allow us (users of TinCanJava) to properly close it before our application shutdowns?
Any other reason that could make Tomcat not be able to stop these threads?