Solr’s RAM appetite is legendary. Don’t worry, you’re not alone. Let’s help you keep your heap happy, your queries snappy, and your boss off your back.
Fewer bytes → less RAM.
See our bandwidth tips.
rows
Parameter!Don’t return all the docs unless you want Solr to host a BBQ in your memory.
&rows=100
Huge start
values = huge RAM usage.
Try not to cross start=50000
unless you really like chaos.
Faceting, sorting, grouping, highlighting:
<field name="my_field" docValues="true" type="string" indexed="true" stored="true"/>
Tighten up your caches in solrconfig.xml
.
<filterCache size="1" initialSize="1" autowarmCount="0"/>
Monitor cache hit ratios; <10% = wasted RAM.
4g
or 8g
is enough.-Xms4g -Xmx4g
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:MaxGCPauseMillis=200
-Xlog:gc*:file=/var/solr/gc.log:time,uptime,level,tags:filecount=10,filesize=10M
Keep Search API Solr current or face the wrath of bugs.
rows
and start
. docValues
for anything you facet, sort, or group.JVM Option | What It Does | Default/Example |
---|---|---|
-Xms / -Xmx |
Min/Max heap size | -Xms4g -Xmx4g |
-XX:+UseG1GC |
Use the G1 Garbage Collector | Always for Java 8+ |
-XX:MaxGCPauseMillis=200 |
Target max GC pause time (ms) | -XX:MaxGCPauseMillis=200 |
-XX:+UseStringDeduplication |
Remove duplicate strings in heap | Java 8u20+ |
-Xlog:gc* |
GC logging | See above |
-XX:+HeapDumpOnOutOfMemoryError |
Write heap dump on OOM | Always! |
-XX:HeapDumpPath=/tmp/solr-heapdump.hprof |
Path for OOM heap dump | Set to a safe disk |
“How many docs can I return? Solr: Yes.”
👉 Contact Opensolr Support — bring logs, configs, and memes. We love a challenge.