I'd guess the getSearcher call you are making is incrementing the ref count and 
you are not decrementing it?

On Jul 18, 2012, at 12:17 PM, Karthick Duraisamy Soundararaj wrote:

> Hi All, 
>            The SolrCore seems to have a reference counted searcher with it. I 
> had to write a customSearchHandler that extends SearchHandler, and I was 
> playing around with it. I did the following change to search handler
> 
> SearchHanlder.java
> --------------------------
> handleRequestBody(SolrQueryRequest req,SolrQueryResponse req)
>  {
>        System.out.println("Reference count Before Search:" 
> +req.getCore().getSearcher.getRefcount)  //In eclipse ..
>            ..................
>             ...........
>         System.out.println("Reference count After Search :" 
> +req.getCore().getSearcher.getRefcount) // In eclipse
> }
> 
> 
> Now, I am surprised to see Reference count not getting decremented at all. 
> Following is the sample output I get
> 
>        Reference count before search:1
>        Reference count after search:2
>        ..............................................
>        Reference count before search:2
>        Reference count after search:3
>          .............................................
>        Reference count before search:4
>        Reference count after search:5
>        ...
>        ....
>        Reference count before search:3000
>        Reference count after search:30001
> 
> 
> The reference count seems to be increasing. Wouldnt this cause a memory leak?
>        
> 
> 
> 
> 
> 

- Mark Miller
lucidimagination.com











Reply via email to