Just create all the clients you need and reuse them all along. By the way in the documentation should be written somewhere what’s the best practices for the Solr clients usages.
Ciao, Vincenzo -- mobile: 3498513251 skype: free.dev > On 5 Feb 2022, at 11:55, Vincenzo D'Amore <[email protected]> wrote: > > >> >> SolrClient Are singletons and are thread safe > You should reuse them > > -- > mobile: 3498513251 > skype: free.dev > >> On 5 Feb 2022, at 02:49, Steven White <[email protected]> wrote: >> >> Hi everyone, >> >> This simple code, is causing me memory and thread loak (threads remain in >> "sleeping" mode): >> >> for (int j = 0; j < 10000; j++) >> { >> SolrClient solrClient = new >> HttpSolrClient.Builder("foo-bar").build(); >> } >> >> Any idea why? Is there an unbuild(), release() or something I have to call? >> >> I'm on Solr 8.11.1 >> >> Thanks >> >> Steven
