# Elasticsearch outofmemory error

**URL:** <https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069>\
**Category:** Elasticsearch\
**Created:** [February 28, 2014, 10:15am UTC](https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069 "2014-02-28T10:15:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bagui/32/960_2.png) [@bagui](https://discuss.elastic.co/u/bagui)\
**Post date:** [February 28, 2014, 10:15am UTC](https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069/1 "2014-02-28T10:15:18Z")

</div>

Hi,

I'm getting the below issue when trying to increase paging in Kibana which  
is using elasticsearch.

[2014-02-28 11:24:29,280][DEBUG][action.search.type] [Nut] [182865] Failed  
to execute fetch phase  
org.elasticsearch.ElasticsearchException: Java heap space  
at  
org.elasticsearch.ExceptionsHelper.convertToRuntime(ExceptionsHelper.java:37)  
at  
org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:451)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:406)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:150)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:134)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:744)

Getting the below error also in elastic search log.

[2014-02-28 11:29:55,121][WARN][cluster.action.shard] [Nut]  
[logstash-2014.02.28][3] sending failed shard for [logstash-2014.02.28][3],  
node[3DLIN4cCRPmMM\_6a\_1yTCA], [P], s[STARTED], indexUUID  
[bWO\_8-eUQQ6WDxcl2KoUkw], reason [engine failure, message  
[MergeException[java.lang.OutOfMemoryError: Java heap space]; nested:  
OutOfMemoryError[Java heap space]; ]]

My Heap allocation in elastic search is....

ES\_HEAP\_SIZE=256m

ES\_DIRECT\_SIZE=512m

Please help to rectify the same.  
Subhadip

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dbf6a5e5-f722-4414-92e3-72268f6336f2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dbf6a5e5-f722-4414-92e3-72268f6336f2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2014, 10:37am UTC](https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069/2 "2014-02-28T10:37:40Z")

</div>

Basically depending on your dataset, it will require more memory or more nodes.  
ES\_HEAP\_SIZE=256m is just too low.

Start with at least 1Gb RAM

As you have a 4Gb machine, you can set it to 2 Gb.  
If it's a production machine, you should not run other IO heavy services on the same physical box (such as database).

My 2 cents

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 28 février 2014 à 11:15:28, Subhadip Bagui ([i.bagui@gmail.com](mailto:i.bagui@gmail.com)) a écrit:

Hi,

I'm getting the below issue when trying to increase paging in Kibana which is using elasticsearch.

[2014-02-28 11:24:29,280][DEBUG][action.search.type] [Nut] [182865] Failed to execute fetch phase  
org.elasticsearch.ElasticsearchException: Java heap space  
at org.elasticsearch.ExceptionsHelper.convertToRuntime(ExceptionsHelper.java:37)  
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:451)  
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:406)  
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:150)  
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:134)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:744)

Getting the below error also in elastic search log.

[2014-02-28 11:29:55,121][WARN][cluster.action.shard] [Nut] [logstash-2014.02.28][3] sending failed shard for [logstash-2014.02.28][3], node[3DLIN4cCRPmMM\_6a\_1yTCA], [P], s[STARTED], indexUUID [bWO\_8-eUQQ6WDxcl2KoUkw], reason [engine failure, message [MergeException[java.lang.OutOfMemoryError: Java heap space]; nested: OutOfMemoryError[Java heap space]; ]]

My Heap allocation in elastic search is....

ES\_HEAP\_SIZE=256m

## ES\_DIRECT\_SIZE=512m Please help to rectify the same. Subhadip

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dbf6a5e5-f722-4414-92e3-72268f6336f2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dbf6a5e5-f722-4414-92e3-72268f6336f2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.531066f4.ded7263.23e%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.531066f4.ded7263.23e%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![bagui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bagui/32/960_2.png) [@bagui](https://discuss.elastic.co/u/bagui)\
**Post date:** [February 28, 2014, 12:58pm UTC](https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069/3 "2014-02-28T12:58:44Z")

</div>

Hi David,

I'm trying to move Elasticsearch on a new system, but while trying to  
start the service its giving below exception. Althrough the process is  
running. There was old elasticsearch 0.90 copied which is not running now  
as I checked. Please suggest.

[2014-02-28 16:40:13,588][WARN][transport.netty] [DJ] Message  
not fully read (response) for [4] handler  
future(org.elasticsearch.indices.recovery.RecoveryTarget$4@1b4268b), error  
[true], resetting  
[2014-02-28 16:40:13,589][WARN][transport.netty] [DJ] Message  
not fully read (response) for [3] handler  
future(org.elasticsearch.indices.recovery.RecoveryTarget$4@151d6cb), error  
[true], resetting  
[2014-02-28 16:40:13,590][WARN][indices.cluster] [DJ]  
[logstash-2014.02.27][1] failed to start shard  
org.elasticsearch.indices.recovery.RecoveryFailedException:  
[logstash-2014.02.27][1]: Recovery failed from  
[Brutacus][L0THepPDR6Cmx7O2jqVLdg][[cloudclient1.aricent.com](http://cloudclient1.aricent.com)][inet[/10.203.251.143:9300]]  
into  
[DJ][LajLfvlYSAGZdsyFnorwEA][[cloudclient.aricent.com](http://cloudclient.aricent.com)][inet[/10.203.251.142:9300]]  
at  
org.elasticsearch.indices.recovery.RecoveryTarget.doRecovery(RecoveryTarget.java:303)  
at  
org.elasticsearch.indices.recovery.RecoveryTarget.access$300(RecoveryTarget.java:65)  
at  
org.elasticsearch.indices.recovery.RecoveryTarget$2.run(RecoveryTarget.java:171)

--  
Thanks  
Subhadip

On Friday, February 28, 2014 3:45:18 PM UTC+5:30, Subhadip Bagui wrote:

> Hi,
> 
> I'm getting the below issue when trying to increase paging in Kibana which  
> is using elasticsearch.
> 
> [2014-02-28 11:24:29,280][DEBUG][action.search.type] [Nut] [182865]  
> Failed to execute fetch phase  
> org.elasticsearch.ElasticsearchException: Java heap space  
> at  
> org.elasticsearch.ExceptionsHelper.convertToRuntime(ExceptionsHelper.java:37)  
> at  
> org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:451)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:406)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:150)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:134)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:744)
> 
> Getting the below error also in Elasticsearch log.
> 
> [2014-02-28 11:29:55,121][WARN][cluster.action.shard] [Nut]  
> [logstash-2014.02.28][3] sending failed shard for [logstash-2014.02.28][3],  
> node[3DLIN4cCRPmMM\_6a\_1yTCA], [P], s[STARTED], indexUUID  
> [bWO\_8-eUQQ6WDxcl2KoUkw], reason [engine failure, message  
> [MergeException[java.lang.OutOfMemoryError: Java heap space]; nested:  
> OutOfMemoryError[Java heap space]; ]]
> 
> My Heap allocation in Elasticsearch is....
> 
> ES\_HEAP\_SIZE=256m
> 
> ES\_DIRECT\_SIZE=512m
> 
> Please help to rectify the same.  
> Subhadip

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d5c38f22-b2a6-4f7e-ba37-a4de3630db0f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d5c38f22-b2a6-4f7e-ba37-a4de3630db0f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:46am UTC](https://discuss.elastic.co/t/elasticsearch-outofmemory-error/16069/4 "2017-07-06T01:46:36Z")

</div>


