How can I set JVM-Memory in Solr-5.0

一曲冷凌霜 提交于 2019-12-21 03:30:14

问题


How can I increase heap space memory in Solr-5.0? I just want to set minimum and maximum Heap space memory of Solr.


回答1:


This info is in the WIKI: https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production#TakingSolrtoProduction-MemoryandGCSettings

SOLR_JAVA_MEM="-Xms10g -Xmx10g"




回答2:


How about using -m option

./solr restart -m 1g

From ./solr --help -

-m Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m




回答3:


Follow the below steps to increase the JVM memory in Solr:

  1. Open solr.in.cmd in any text editor (path: bin/solr.in.cmd)

  2. Add the set SOLR_JAVA_MEM=-Xms1g -Xmx1g ( it will set the minimum and maximum Java heap memory by 1 GB. however you will only able the see 981.38 MB in solr dashboard)

  3. save the solr.in.cmd file and restart the solr



回答4:


For Centos 7 the modification is in the file bin/solr, e.g. to increase it to 5G :

vim /opt/solr/bin/solr

Edit the block of code:

JAVA_MEM_OPTS=()
if [ -z "$SOLR_HEAP" ] && [ -n "$SOLR_JAVA_MEM" ]; then
  JAVA_MEM_OPTS=($SOLR_JAVA_MEM)
else
  SOLR_HEAP="${SOLR_HEAP:-512m}"
  JAVA_MEM_OPTS=("-Xms5g" "-Xmx5g")
fi


来源:https://stackoverflow.com/questions/29029904/how-can-i-set-jvm-memory-in-solr-5-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!