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