Hi,
Environment:
OS : Windows 64-bit
ElasticSearch : 6.6.2
Java: 1.8.151
Cluster: Single Node cluster
Index strategy: Indices are created daily and programmatically
Shard: Single shard per index and no replication
We have been using elasticsearch for more than a month.
The machine contains approximately 30 indices (data for 30 days).
Total size of all the indices is around 100s of GBs.
Recently, We have been facing elasticsearch crashes in most of the machines.
Few queries from logs:
=============================================================================================================================================
#1: Why GC is running frequently? Why does it consume time in seconds for Garbage collection?
There is enough space remaining in the machine. And data rate is almost same in most of the days.
Why is JVM crash because of out of memory exception?
[2019-05-08T02:18:58,275][WARN ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][12982] overhead, spent [513ms] collecting in the last [1s]
[2019-05-08T02:19:55,482][INFO ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13039] overhead, spent [376ms] collecting in the last [1.1s]
[2019-05-08T02:21:14,601][INFO ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13118] overhead, spent [441ms] collecting in the last [1s]
[2019-05-08T02:22:05,676][INFO ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13169] overhead, spent [491ms] collecting in the last [1s]
[2019-05-08T02:22:08,679][INFO ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13172] overhead, spent [475ms] collecting in the last [1s]
[2019-05-08T02:22:10,097][WARN ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13173] overhead, spent [844ms] collecting in the last [1.4s]
[2019-05-08T02:22:14,684][WARN ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13174] overhead, spent [3.4s] collecting in the last [3.4s]
[2019-05-08T02:22:15,829][WARN ][o.e.m.j.JvmGcMonitorService] [EIcXa59] [gc][13175] overhead, spent [2.2s] collecting in the last [2.2s]
[2019-05-08T02:22:15,828][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [EIcXa59] fatal error in thread [elasticsearch[EIcXa59][search][T#78]], exiting
java.lang.OutOfMemoryError: Java heap space
at org.elasticsearch.common.util.PageCacheRecycler$1.newInstance(PageCacheRecycler.java:111) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.PageCacheRecycler$1.newInstance(PageCacheRecycler.java:108) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.DequeRecycler.obtain(DequeRecycler.java:53) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.AbstractRecycler.obtain(AbstractRecycler.java:33) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.DequeRecycler.obtain(DequeRecycler.java:28) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.FilterRecycler.obtain(FilterRecycler.java:39) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.Recyclers$3.obtain(Recyclers.java:119) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.recycler.FilterRecycler.obtain(FilterRecycler.java:39) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.PageCacheRecycler.bytePage(PageCacheRecycler.java:159) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.AbstractBigArray.newBytePage(AbstractBigArray.java:117) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.BigByteArray.resize(BigByteArray.java:143) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.BigArrays.resizeInPlace(BigArrays.java:440) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.BigArrays.resize(BigArrays.java:487) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.util.BigArrays.grow(BigArrays.java:505) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.io.stream.BytesStreamOutput.ensureCapacity(BytesStreamOutput.java:158) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput.ensureCapacity(ReleasableBytesStreamOutput.java:70) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.io.stream.BytesStreamOutput.writeBytes(BytesStreamOutput.java:90) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.io.Streams$FlushOnCloseOutputStream.writeBytes(Streams.java:266) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.io.stream.StreamOutput.write(StreamOutput.java:460) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.copyStream(JsonXContentGenerator.java:502) ~[elasticsearch-x-content-6.6.2.jar:6.6.2]
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.writeRawField(JsonXContentGenerator.java:352) ~[elasticsearch-x-content-6.6.2.jar:6.6.2]
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.writeRawField(JsonXContentGenerator.java:333) ~[elasticsearch-x-content-6.6.2.jar:6.6.2]
at org.elasticsearch.common.xcontent.XContentBuilder.rawField(XContentBuilder.java:967) ~[elasticsearch-x-content-6.6.2.jar:6.6.2]
at org.elasticsearch.common.xcontent.XContentHelper.writeRawField(XContentHelper.java:308) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.search.SearchHit.toInnerXContent(SearchHit.java:466) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.search.SearchHit.toXContent(SearchHit.java:408) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.search.SearchHits.toXContent(SearchHits.java:158) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.action.search.SearchResponseSections.toXContent(SearchResponseSections.java:106) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.action.search.SearchResponse.innerToXContent(SearchResponse.java:241) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.action.search.SearchResponse.toXContent(SearchResponse.java:221) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.rest.action.RestStatusToXContentListener.buildResponse(RestStatusToXContentListener.java:57) ~[elasticsearch-6.6.2.jar:6.6.2]
at org.elasticsearch.rest.action.RestStatusToXContentListener.buildResponse(RestStatusToXContentListener.java:33) ~[elasticsearch-6.6.2.jar:6.6.2]
Thanks,
HGVP