Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase heap size in solr or tomcat?

Tags:

solr

tomcat

When i run the command below: 127.0.0.1:8080/solr/suggest?spellcheck.build=true I got an exception as below, anyone knows how to increase heap size in tomcat or solr?

Apache Tomcat/7.0.27 - Error report

HTTP Status 500 - Java heap space

java.lang.OutOfMemoryError: Java heap space

type Status report

message Java heap space

java.lang.OutOfMemoryError: Java heap space

description The server encountered an internal error (Java heap space

java.lang.OutOfMemoryError: Java heap space ) that prevented it from fulfilling this request.

Apache Tomcat/7.0.27

%
like image 204
trillions Avatar asked Nov 24 '25 17:11

trillions


1 Answers

Find the command that you use to start the server that runs Solr (Tomcat or Jetty) and add java heap size options to it - e.g. -Xmx500m will set a max heap size of 500 MB, and -Xms300m will set an initial heap size of 300 MB.

For Tomcat, find catalina.sh, open it up and find the line that sets CATALINA_OPTS. Add the options for -Xms and -Xmx to that line. In Windows you don't put them in quotes, and in Linux you do.

like image 147
Ansari Avatar answered Nov 28 '25 03:11

Ansari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!