lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Priya Rodrigues <roddied...@gmail.com>
Subject IndexSearcher not being closed
Date Wed, 19 Nov 2014 13:37:07 GMT
Hi,

I am running into OOM errors on Solr 4.6. Our index size is quite small at
5000 documents and 75MB index size.

While debugging this OOM, I found that the IndexSearcher Refcount is not
coming down to 0 and hence the index searcher is not released on commits.

We are using custom request handlers - the handler spawns multiple internal
requests. All SolrQueryRequests created are closed at the end, refcounts
are incremented and then decremented,

The culprit seems to be TextResponseWriter, writeDocuments which is
incrementing the ref count twice. Snippets below.

context.searcher = req.getSearcher() -> RefCount incremented
    context.iterator = ids.iterator();
    if( transformer != null ) {
      transformer.setContext( context ) -> This calls setContext in the
class ValueSourceAugmenter, below
    }

public void setContext( TransformContext context ) {
    try {
      IndexReader reader = qparser.getReq().getSearcher().getIndexReader();
->Refcount incremented


Whereas the refcount is decremented just once
in SolrDispatchFilter, doFilter()

 finally {
        if( solrReq != null ) {
          log.debug("Closing out SolrRequest: {}", solrReq);
          solrReq.close(); -> RefCount decremented
        }
        if (core != null) {
          core.close();
        }
        SolrRequestInfo.clearRequestInfo();
      }

Is this a bug or am I missing something.

Thanks,
Priya

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message