Tomcat – How to increase heap size in solr or tomcat

solrtomcat

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

%

Best Answer

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.

Related Topic