# \[es-XXXX\] \[XXXXXXXX\]\[1\] failed to execute multi\_get for \[6\]/\[XXXXXXX\] java.lang.OutOfMemoryError: Java heap space

**URL:** <https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839>\
**Category:** Elasticsearch\
**Created:** [January 11, 2016, 7:20am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839 "2016-01-11T07:20:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)\
**Post date:** [January 11, 2016, 7:20am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/1 "2016-01-11T07:20:01Z")

</div>

[2015-12-30 13:50:13,088][INFO][monitor.jvm] [es-v2-23] [gc][young][1179360][5062] duration [960ms], collections [1]/[1.5s], total [960ms]/[1.9m], memory [3.4gb]-\>[2.7gb]/[5.8gb], all\_pools {[young] [1gb]-\>[1.1mb]/[1.2gb]}{[survivor] [128mb]-\>[128mb]/[128mb]}{[old] [2.2gb]-\>[2.6gb]/[4.5gb]}  
[2015-12-30 14:15:16,936][DEBUG][action.get] [es-XXX] [XXXXXX][1] failed to execute multi\_get for [6]/[178901]  
[2015-12-30 14:15:16,936][DEBUG][action.get] [es-XXXX] [XXXXXXXX][1] failed to execute multi\_get for [6]/[178901]  
java.lang.OutOfMemoryError: Java heap space

---

<div class="post-metadata">

**Author:** ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)\
**Post date:** [January 11, 2016, 7:20am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/2 "2016-01-11T07:20:28Z")

</div>

Hi can any one suggest y the out of memory occured ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 11, 2016, 7:22am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/3 "2016-01-11T07:22:14Z")

</div>

Yes? You've run out of JVM heap, so either increase the capacity of your cluster, reduce the amount of data, scale back the complexity of the queries, or enable doc values if you haven't already. Without further details exact suggestions are impossible.

---

<div class="post-metadata">

**Author:** ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)\
**Post date:** [January 11, 2016, 7:25am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/4 "2016-01-11T07:25:12Z")

</div>

Hi requesting you to contirm how u arrive that out of JVM heap ....

We got this error from 5 node cluster and in sequential mget query thrown error and node crashed

---

<div class="post-metadata">

**Author:** ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)\
**Post date:** [January 11, 2016, 7:27am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/5 "2016-01-11T07:27:27Z")

</div>

Also guide us that how we can avoid OOM error

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 11, 2016, 8:33am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/6 "2016-01-11T08:33:11Z")

</div>

Can you please provide some details about what you are doing when you get the out of memory error? How large are your multi\_get requests? What is the size of your documents? How many concurrent requests are you sending? What is the specification of the cluster?

In order to identify the amount of heap being used and visualise the load on the cluster I would recommend installing [Marvel](https://www.elastic.co/products/marvel).

---

<div class="post-metadata">

**Author:** ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)\
**Post date:** [January 11, 2016, 9:00am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/7 "2016-01-11T09:00:32Z")

</div>

Java heap size is 5.8gb  
[jalbertemmanuel@yamuna21 ~]$ curl 'http://\*\*\*\*\*\*\*\*\*\*\*\*/\_cat/nodes?v&h=n,d,hp,hm,rm,fm,fe'  
n d hp hm rm fm fe  
es-v1-XX 1.1tb 60 5.8gb 252.2gb 171.3mb 0  
es-v1-XX 4.4tb 43 5.8gb 251.3gb 147.7mb 0  
es-v1-XX 4.4tb 59 5.8gb 251.3gb 168.1mb 0  
es-v1-XX 4.2tb 58 5.8gb 251.3gb 114.2mb 0  
es-v1-XX 4.2tb 14 5.8gb 252.1gb 112mb 0

First No mapping occured and leads to mget to fail with out of memory error

[2015-12-30 12:58:22,923][WARN][index.codec] [] no index mapper found for field: [agreementTypes.firmId] returning default postings format  
[2015-12-30 12:58:22,923][WARN][index.codec] [] no index mapper found for field: [[agreementTypes.id](http://agreementTypes.id)] returning default postings format  
[2015-12-30 12:58:22,923][WARN][index.codec] ] no index mapper found for field: [agreementTypes.lastUpdateDate] returning default postings format  
[2015-12-30 12:58:22,924][WARN][index.codec] [no index mapper found for field: [agreementTypes.lastUpdatedBy] returning default postings format  
[2015-12-30 12:58:22,924][WARN][index.codec] [2] no index mapper found for field: [agreementTypes.moduleId] returning default postings format  
[2015-12-30 12:58:22,924][WARN][index.codec] [] no index mapper found for field: [agreementTypes.moduleName] returning default postings format  
[2015-12-30 12:58:22,924][WARN][index.codec] [] no index mapper found for field: [agreementTypes.startDate]

[2015-12-30 13:50:13,088][INFO][monitor.jvm] [] [gc][young][1179360][5062] duration [960ms], collections [1]/[1.5s], total [960ms]/[1.9m], memory [3.4gb]-\>[2.7gb]/[5.8gb], all\_pools {[young] [1gb]-\>[1.1mb]/[1.2gb]}{[survivor] [128mb]-\>[128mb]/[128mb]}{[old] [2.2gb]-\>[2.6gb]/[4.5gb]}  
[2015-12-30 14:15:16,936][DEBUG][action.get] [] [][1] failed to execute multi\_get for [6]/[]  
[2015-12-30 14:15:16,936][DEBUG][action.get] ][1] failed to execute multi\_get for [6]/[]  
java.lang.OutOfMemoryError: Java heap space

[2015-12-30 14:17:42,628][INFO][index.search.slowlog.query] ] [][3] took[6.9s], took\_millis[6940], types[59], stats[], search\_type[QUERY\_AND\_FETCH], total\_shards[1], source[{"explain":false,"facets":{"f":{"terms":{"field":"assignedObjectRefId","size":10000000},"facet\_filter":{"and":{"filters":[{"term":{"firmId"}},{"term":{"deleted":"0"}},{"or":{"filters":[{"term":{"isActive":"Y"}},{"missing":{"field":"isActive","null\_value":true,"existence":true}}]}},{"term":{"assignedObjectId":91}},{"or":{"filters":[]}}]}}}}}], extra\_source[],  
[2015-12-30 14:19:06,808][INFO][index.search.slowlog.query] [] [][1] took[6.9s], took\_millis[6936], types[168], stats[], search\_type[QUERY\_AND\_FETCH], total\_shards[1], source[{"from":0,"size":15,"post\_filter":{"and":{"filters":[{"terms":{"objectStatus":["0"]}},{"term":{"firmId":}},{"query":{"terms":{"\_all":["customize","fields","in","free","version"]}}},{"or":{"filters":[]}}]}},"explain":false,"sort":[{"creationDate":{"order":"desc"}}]}], extra\_source[],

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 11, 2016, 10:25am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/8 "2016-01-11T10:25:53Z")

</div>

That does unfortunately not really answer the questions I asked. It however looks like you have a query with a very large size value set, which can cause a large amount of heap to be used. [This blog post](https://www.elastic.co/blog/found-crash-elasticsearch) provides additional details around things to avoid doing to your Elasticsearch cluster.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 12, 2016, 2:21am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/9 "2016-01-12T02:21:27Z")

</div>

Please don't create multiple threads for the same thing as it makes it really difficult to help, you already have [Multi\_get throws error](https://discuss.elastic.co/t/multi-get-throws-error/38319/7) here so let's use that.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 12, 2016, 2:21am UTC](https://discuss.elastic.co/t/es-xxxx-xxxxxxxx-1-failed-to-execute-multi-get-for-6-xxxxxxx-java-lang-outofmemoryerror-java-heap-space/38839/10 "2016-01-12T02:21:32Z")

</div>


