solr - java heap space out of memory

后端 未结 4 943
误落风尘
误落风尘 2021-01-04 04:23

Can any one help me to find out the error cause in tomcat. i m using solr in it. starting it works fine. later i will raise this error. after restarting it works fine. plea

相关标签:
4条回答
  • 2021-01-04 04:29

    Try to increase your memory

    Either set the environment variable JAVA_OPTS="-Xms256m -Xmx500m" which means heap start size is 256 MB, max 512 MB. Or edit your catalina.bat or .sh and add this line there.

    You have to play around with these values, some weeks ago I had an SOLR indexer job, about 2 GB of data, 700MB heap were required.

    0 讨论(0)
  • 2021-01-04 04:32

    start tomcat with an -Xmx1024m or some larger value to give tomcat more heap space.

    0 讨论(0)
  • 2021-01-04 04:34

    You can try lowering the default batchSize JDBC connection param in your dataSource definition.
    DataImportHandler is designed to stream row one-by-one. It passes a fetch size value (default: 500) to Statement#setFetchSize which some drivers do not honor.

    If you're using MsSQL you can add dataSource param responseBuffering="adaptive".

    See here for more info:
    http://wiki.apache.org/solr/DataImportHandlerFaq

    0 讨论(0)
  • 2021-01-04 04:44

    you should definitely look into tuning your JVM. to start with you should alter your JVM parameters to emit a Garbage Collection log and then use a tool to analyze that log. this analysis will help you to pick sane values for your heap, and it will also allow you to gauge whether or not you really have a memory leak or just a heap tuning issue. see this related question for some info on GC analysis tools:

    Analyze GC logs for Sun Hotspots, JVM 6

    0 讨论(0)
提交回复
热议问题