Hi, I'm facing the issue that my Elasticsearch data nodes shutdown automatically for some searches.
Elasticsearch version - 6.3.2
Ram - 8gb
Heap size - 1gb
Documents - 7000(max)
This is the error ->
at java.lang.OutOfMemoryError.<init>(OutOfMemoryError.java:48)
at java.util.TreeMap.put(TreeMap.java:577)
Local Variable: java.util.TreeMap#2
Local Variable: java.lang.Integer#160
Local Variable: java.util.TreeMap$Entry#149
Local Variable: java.lang.Integer#294
at org.apache.lucene.util.automaton.SortedIntSet.incr(SortedIntSet.java:53)
at org.apache.lucene.util.automaton.Operations.determinize(Operations.java:780)
Local Variable: org.apache.lucene.util.automaton.Automaton$Builder#2
Local Variable: java.util.HashMap#3
Local Variable: java.util.ArrayDeque#2
Local Variable: org.apache.lucene.util.automaton.SortedIntSet#2
Local Variable: org.apache.lucene.util.automaton.Operations$PointTransitionSet#2
Local Variable: int[]#8065
Local Variable: org.apache.lucene.util.automaton.Automaton#1980
at org.apache.lucene.util.automaton.Operations.getCommonSuffixBytesRef(Operations.java:1155)
at org.apache.lucene.util.automaton.CompiledAutomaton.<init>(CompiledAutomaton.java:238)
Local Variable: org.apache.lucene.util.automaton.CompiledAutomaton#1108
Local Variable: org.apache.lucene.util.automaton.Automaton#1979
at org.apache.lucene.search.AutomatonQuery.<init>(AutomatonQuery.java:104)
at org.apache.lucene.search.AutomatonQuery.<init>(AutomatonQuery.java:81)
at org.apache.lucene.search.WildcardQuery.<init>(WildcardQuery.java:67)
at org.apache.lucene.queryparser.classic.QueryParserBase.newWildcardQuery(QueryParserBase.java:644)
at org.apache.lucene.queryparser.classic.QueryParserBase.getWildcardQuery(QueryParserBase.java:703)
at org.elasticsearch.index.search.QueryStringQueryParser.getWildcardQuerySingle(QueryStringQueryParser.java:666)
Local Variable: java.lang.String#170193
at org.elasticsearch.index.search.QueryStringQueryParser.getWildcardQuery(QueryStringQueryParser.java:640)
Local Variable: java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1#2
Local Variable: java.lang.String#220606
Local Variable: java.util.ArrayList#9417
Local Variable: java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry#4
at org.apache.lucene.queryparser.classic.QueryParserBase.handleBareTokenQuery(QueryParserBase.java:820)
at org.apache.lucene.queryparser.classic.QueryParser.Term(QueryParser.java:469)
at org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:355)
at org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:244)
Local Variable: java.util.ArrayList#9418
at org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:215)
at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:109)
Local Variable: java.lang.String#220898
Local Variable: org.elasticsearch.index.search.QueryStringQueryParser#3
at org.elasticsearch.index.search.QueryStringQueryParser.parse(QueryStringQueryParser.java:786)
at org.elasticsearch.index.query.QueryStringQueryBuilder.doToQuery(QueryStringQueryBuilder.java:1041)
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:98)
Local Variable: org.elasticsearch.index.query.QueryStringQueryBuilder#70
at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:404)
Local Variable: java.util.ArrayList$Itr#3
at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:378)
Local Variable: org.apache.lucene.search.BooleanQuery$Builder#3
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:98)
Local Variable: org.elasticsearch.index.query.BoolQueryBuilder#54
at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:404)
Local Variable: java.util.ArrayList$Itr#4
at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:380)
Local Variable: org.apache.lucene.search.BooleanQuery$Builder#4
at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:98)
at org.elasticsearch.index.query.QueryShardContext.lambda$toQuery$2(QueryShardContext.java:304)
at org.elasticsearch.index.query.QueryShardContext$$Lambda$2900.apply(<unknown string>)
at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:316)
Local Variable: org.elasticsearch.index.query.QueryShardContext$$Lambda$2900#2
at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:303)
Local Variable: org.elasticsearch.index.query.BoolQueryBuilder#53
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:724)
Local Variable: java.util.HashMap#63550
Local Variable: org.elasticsearch.search.builder.SearchSourceBuilder#14
Local Variable: org.elasticsearch.index.query.QueryShardContext#3
at org.elasticsearch.search.SearchService.createContext(SearchService.java:575)
Local Variable: org.elasticsearch.search.DefaultSearchContext#2
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:551)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:347)
Local Variable: org.elasticsearch.action.search.SearchTask#11
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:333)
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:329)
Local Variable: org.elasticsearch.search.internal.ShardSearchTransportRequest#14
Local Variable: org.elasticsearch.search.SearchService$2#11
at org.elasticsearch.search.SearchService$3.doRun(SearchService.java:1019)
Local Variable: org.elasticsearch.search.SearchService$3#11
On evaluating the ".hprof" file for heap dump these are the problem suspects:
Can you guys tell me what is the problem here? Is it because of my queries or less heap size?