How to make sure Solr/Lucene won't die with java.lang.OutOfMemoryError?

前端 未结 8 680
失恋的感觉
失恋的感觉 2021-02-04 06:31

I\'m really puzzled why it keeps dying with java.lang.OutOfMemoryError during indexing even though it has a few GBs of memory.

Is there a fundamental reason why it needs

8条回答
  •  终归单人心
    2021-02-04 06:40

    Looking at the stack trace, it looks like you are performing a search, and sorting by a field. If you need to sort by a field, internally Lucene needs to load up all the values of all the terms in the field into memory. If the field contains a lot of data, then it is very possible that you may run out of memory.

提交回复
热议问题