Bug #7570

Search UI requests cause Out of Memory Error

Added by Chris Jones about 8 years ago. Updated almost 7 years ago.

In Progress
Target version:
Start date:
Due date:
% Done:


Product Version:
Story Points:


When deploying the 1.9.0 Search UI, we saw out of memory errors in Solr on the CN. The requests executed by the UI in sequential order are:,seriesId,title,origin,pubDate,dateUploaded,abstract,resourceMap,beginDate,endDate,read_count_i,geohash_9,datasource,isPublic,northBoundCoord,southBoundCoord,eastBoundCoord,westBoundCoord&q=++++-obsoletedBy:*+formatType:METADATA++&sort=dateUploaded+desc&rows=25&start=0&facet=true&facet.sort=index&facet.field=geohash_1&facet.field=geohash_2&facet.field=geohash_3&facet.field=geohash_4&facet.field=geohash_5&facet.field=geohash_6&facet.field=geohash_7&facet.field=geohash_8&facet.field=geohash_9&facet.mincount=1&facet.limit=-1&wt=json*+formatType:METADATA+++beginDate:[1800-01-01T00:00:00Z TO NOW]&rows=1&fl=beginDate&sort=beginDate+asc&wt=json*+formatType:METADATA+++endDate:[1800-01-01T00:00:00Z TO NOW]+-obsoletedBy:*&rows=1&fl=endDate&sort=endDate+desc&wt=json*+formatType:METADATA++&rows=0&facet=true&facet.sort=count&facet.mincount=1&facet.limit=-1&facet.field=keywords&facet.field=origin&facet.field=family&facet.field=species&facet.field=genus&facet.field=kingdom&facet.field=phylum&facet.field=order&facet.field=class&facet.field=site&facet.field=attributeName&facet.field=attributeLabel&wt=json&json.wrf=jQuery19109610712484859317_1452005239758&_=1452005239759

Here's the stacktrace reported back to the Search UI:

"error":{"msg":"Error while processing facet fields: java.lang.OutOfMemoryError: Java heap space","trace":"org.apache.solr.common.SolrException: Error while processing facet fields: java.lang.OutOfMemoryError: Java heap space
at org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
at org.apache.solr.request.SimpleFacets.getFacetCounts(
at org.apache.solr.handler.component.FacetComponent.process(
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(
at org.dataone.solr.handler.component.SolrSearchHandler.handleRequestBody(
at org.apache.solr.handler.RequestHandlerBase.handleRequest(
at org.apache.solr.core.SolrCore.execute(
at org.apache.solr.servlet.HttpSolrCall.execute(
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
at org.dataone.solr.servlet.SessionAuthorizationUtil.handleNoCertificateManagerSession(
at org.dataone.solr.servlet.SearchServiceSessionAuthorizationFilter.handleNoCertificateManagerSession(
at org.dataone.solr.servlet.SessionAuthorizationFilterStrategy.doFilter(
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
Caused by: java.lang.OutOfMemoryError: Java heap space

To temporarily alleviate the issue, I restarted Solr on the 3 CNs. That had no effect, so I modified the Solr configuration in /var/solr/ to request 2048m of Java heap space (up from 512m that was in the file), and restarted Solr. That, too, had no effect. I then bumped it to 4096m, restarted, and all queries started to work again.

Related issues

Related to Infrastructure - Bug #8027: Heap memory errors from solr Closed 2017-02-27


#1 Updated by Chris Jones about 8 years ago

  • Description updated (diff)

#2 Updated by Dave Vieglais about 8 years ago

  • Assignee changed from Skye Roseboom to Andrei Buium


#3 Updated by Andrei Buium almost 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30

Lauren has split the UI query most likely to be the culprit (the last one containing many facets) into multiple queries.
Other options to consider:
Using docValues="true" in the schema for fields often sorted/faceted on (would speed up query time and lower memory use at query time but increase total index size due to a forward map being created).
Checking if store="true" is absolutely necessary on all the current schema fields (NOTE: displaying formats without an existing xslt relies on solr stored fields).
Delivering a cached result (preferably also created from multiple queries).
Using SolrCloud to shard the index and split memory use more evenly across different nodes.
Further increasing memory allowed. (May be necessary regardless. Is it currently possible for a user to kill solr with a complicated query?)

#4 Updated by Dave Vieglais almost 7 years ago

  • Project changed from CN Index to Infrastructure
  • Tracker changed from Task to Bug
  • Target version set to CCI-2.4.0
  • Milestone set to None
  • Category set to d1_indexer
  • Assignee changed from Andrei Buium to Jing Tao

#5 Updated by Dave Vieglais almost 7 years ago

  • Related to Bug #8027: Heap memory errors from solr added

#6 Updated by Rob Nahf almost 7 years ago

fwiw, I ran across this while investigating solr heap errors reported in a different bug ( #8027 )

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)