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

前端 未结 8 660
失恋的感觉
失恋的感觉 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 07:00

    An old question but since I stumbled upon it:

    1. The String Field Cache is lot more compact from Lucene 4.0. So lot can fit in.
    2. Field Cache is an in-memory structure. So can't prevent OOME.
    3. For fields which need sorting or faceting - one should try DocValues to overcome this problem. DocValues do work with numeric and non-analyzed string values. And I presume many use cases of sorting/faceting will have one of these value types.

提交回复
热议问题