lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Memory leak defect or misssuse of SolrJ API?
Date Sat, 30 Jan 2016 18:24:39 GMT
Assuming you're not really using code like above and it's a test case....

What's your evidence that memory consumption goes up? Are you sure
you're not just seeing uncollected garbage?

When I attached Java Mission Control to this program it looked pretty
scary at first, but the heap allocated after old generation garbage
collections leveled out to a steady state.


On Sat, Jan 30, 2016 at 9:29 AM, Walter Underwood <wunder@wunderwood.org> wrote:
> Create one HttpSolrClient object for each Solr server you are talking to. Reuse it for
all requests to that Solr server.
>
> It will manage a pool of connections and keep them alive for faster communication.
>
> I took a look at the JavaDoc and the wiki doc, neither one explains this well. I don’t
think they even point out what is thread safe.
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>
>> On Jan 30, 2016, at 7:42 AM, Susheel Kumar <susheel2777@gmail.com> wrote:
>>
>> Hi Steve,
>>
>> Can you please elaborate what error you are getting and i didn't understand
>> your code above, that why initiating Solr client object  is in loop.  In
>> general  creating client instance should be outside the loop and a one time
>> activity during the complete execution of program.
>>
>> Thanks,
>> Susheel
>>
>> On Sat, Jan 30, 2016 at 8:15 AM, Steven White <swhite4141@gmail.com> wrote:
>>
>>> Hi folks,
>>>
>>> I'm getting memory leak in my code.  I narrowed the code to the following
>>> minimal to cause the leak.
>>>
>>>    while (true) {
>>>        HttpSolrClient client = new HttpSolrClient("
>>> http://192.168.202.129:8983/solr/core1");
>>>        client.close();
>>>    }
>>>
>>> Is this a defect or an issue in the way I'm using HttpSolrClient?
>>>
>>> I'm on Solr 5.2.1
>>>
>>> Thanks.
>>>
>>> Steve
>>>
>

Mime
View raw message