You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Peter Markey <su...@gmail.com> on 2012/02/10 19:00:24 UTC
Solrj Stream Server memory leak
Hello,
I am using the SolrJ client's StreamingUpdateSolrServer and when ever i
stop tomcat, it throws a memory leak warning. sample error message:
SEVERE: The web application [/MyApplication] appears to have started a
thread named [pool-1004-thread-1] but has failed to stop it. This is very
likely to create a memory leak.
Feb 10, 2012 9:57:47 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
Any ideas as to how I can solve this problem would deeply be appreciated.
BTW, I'm using sold 3.5 under tomcat 7.0 with java 1.6 on a mac.
Thanks a lot
Re: Solrj Stream Server memory leak
Posted by Chris Hostetter <ho...@fucit.org>.
: I am using the SolrJ client's StreamingUpdateSolrServer and when ever i
: stop tomcat, it throws a memory leak warning. sample error message:
:
: SEVERE: The web application [/MyApplication] appears to have started a
: thread named [pool-1004-thread-1] but has failed to stop it. This is very
: likely to create a memory leak.
as part of the SolrCloud work (SOLR-2358) a "shutdown()" method was added
to CommonsHttpSolrServer (and StreamingUpdateSolrServer) to instruct it to
shutdown the HttpClient it wraps (if it created it). So if you are using
trunk, you should call that when you are done with the
StreamingUpdateSolrServer object.
As a workarround in 3x, you can instantiate the HttpClient yourself using
the MultiThreadedHttpConnectionManager, and pass it to the
StreamingUpdateSolrServer constructor. then when your app shuts down, you
can call shutdown on the HttpClient.
alternately: the minimal ammount of change you can make to work
arround tthis would be to add a call to the static method...
MultiThreadedHttpConnectionManager.shutdownAll();
...some where in your app's shutdown code (assuming it doesn't cause
problems with any subsequent shutdown code)
-Hoss