1

I know I can pass parameters to java to limit the amount of memory used, but that doesn't change the application behavior. (assuming I will get an out of memory exception or similar)

I would like to limit the amount of memory that solr uses. I am assuming it is as simple as setting a single configuration option, but googling so far has been fruitless.

Any ideas? Thanks!

Edit: I just want to note that I understand there will be a tradeoff between memory usage and execution speed. In this case, I am willing to sacrifice speed to reduce memory footprint. I also understand that it is possible that solr does not support the option of tuning this tradeoff.

cat pants
  • 2,139
  • 10
  • 33
  • 44

2 Answers2

1

Solr's memory limit is the JVM's heap memory limit. There's no separate configuration.

The notes here indicate that Solr's memory usage will indeed eclipse the JVM's limit on occasion, but that it will attempt to "make it right" by freeing heap space when an OutOfMemoryError is fired.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
1

This page has a ton of useful information on how to reduce/optimize Solr's memory consumption.

http://wiki.apache.org/solr/SolrPerformanceFactors

But I will point out one major thing from this document:

The number of indexed fields greatly increases the following:

  • Memory usage during indexing
  • Segment merge time
  • Optimization times
  • Index size

Double-check to ensure you aren't indexing fields you will never search on in your schema.xml file.

Also, in that document, take a look at "Factors Affecting Memory Usage" at the bottom of the page.

Hope this helps,

-C