Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

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

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,


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.