# "java.lang.OutOfMemoryError: Java heap space" Still 337 MB RAM available

**URL:** <https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068>\
**Category:** Elasticsearch\
**Created:** [August 4, 2014, 12:34pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068 "2014-08-04T12:34:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Stabenfeldt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_stabenfeldt/32/1360_2.png) [@Martin\_Stabenfeldt](https://discuss.elastic.co/u/Martin_Stabenfeldt)\
**Post date:** [August 4, 2014, 12:34pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068/1 "2014-08-04T12:34:49Z")

</div>

Hi,

This error arrived today after I rebooted my Mac.  
It might have been something that OS X has updated since last time, I don't  
know that for sure.  
I'm running "elasticsearch: stable 1.3.1, HEAD". Installed with Homebrew.

Any suggestions to how I can resolve this problem?

$ ps aux|grep java

> martins 13093 100.2 14.1 3810672 1179436 ?? R 2:10PM  
> 15:32.24 /usr/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true  
> -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
> -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly  
> -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Xss200000  
> -Delasticsearch -Des.foreground=yes  
> -Des.path.home=/usr/local/Cellar/elasticsearch/1.3.1 -cp  
> :/usr/local/Cellar/elasticsearch/1.3.1/libexec/elasticsearch-1.3.1.jar:/usr/local/Cellar/elasticsearch/1.3.1/libexec/_:/usr/local/Cellar/elasticsearch/1.3.1/libexec/sigar/_  
> -Des.config=/usr/local/Cellar/elasticsearch/1.3.1/config/elasticsearch.yml  
> org.elasticsearch.bootstrap.Elasticsearch

$ tail -f /usr/local/var/log/elasticsearch/elasticsearch\_martins.log

> at  
> org.elasticsearch.indices.cluster.IndicesClusterStateService.processMapping(IndicesClusterStateService.java:408)  
> at  
> org.elasticsearch.indices.cluster.IndicesClusterStateService.applyMappings(IndicesClusterStateService.java:362)  
> at  
> org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:181)  
> at  
> org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:444)  
> at  
> org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)  
> 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:724)  
> [2014-08-04 14:24:08,057][ERROR][rest.action.support] failed to send  
> failure response  
> java.lang.OutOfMemoryError: Java heap space

I have currently 337 MB RAM free. That should be enough, should it not?

_elasticsearch.yml_

> cluster.name: elasticsearch\_martins  
> path.data: /usr/local/var/elasticsearch/  
> path.logs: /usr/local/var/log/elasticsearch/  
> path.plugins: /usr/local/var/lib/elasticsearch/plugins  
> network.host: 127.0.0.1

Cheers,  
Martin Stabenfeldt

--  
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/d0c3a6d2-2fe3-4c79-91b5-cac73e521cb1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0c3a6d2-2fe3-4c79-91b5-cac73e521cb1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Martin\_Stabenfeldt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_stabenfeldt/32/1360_2.png) [@Martin\_Stabenfeldt](https://discuss.elastic.co/u/Martin_Stabenfeldt)\
**Post date:** [August 4, 2014, 12:41pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068/2 "2014-08-04T12:41:09Z")

</div>

Discovered that /usr/local/var/elasticsearch had grown to 14GB  
As it's my develop machine, I did not need the old data and deleted it.

Started ES again and things went back to normal! 🙂

On Monday, August 4, 2014 2:34:49 PM UTC+2, Martin Stabenfeldt wrote:

> Hi,
> 
> This error arrived today after I rebooted my Mac.  
> It might have been something that OS X has updated since last time, I  
> don't know that for sure.  
> I'm running "elasticsearch: stable 1.3.1, HEAD". Installed with Homebrew.
> 
> Any suggestions to how I can resolve this problem?
> 
> $ ps aux|grep java
> 
> > martins 13093 100.2 14.1 3810672 1179436 ?? R 2:10PM  
> > 15:32.24 /usr/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true  
> > -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
> > -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly  
> > -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Xss200000  
> > -Delasticsearch -Des.foreground=yes  
> > -Des.path.home=/usr/local/Cellar/elasticsearch/1.3.1 -cp  
> > :/usr/local/Cellar/elasticsearch/1.3.1/libexec/elasticsearch-1.3.1.jar:/usr/local/Cellar/elasticsearch/1.3.1/libexec/_:/usr/local/Cellar/elasticsearch/1.3.1/libexec/sigar/_  
> > -Des.config=/usr/local/Cellar/elasticsearch/1.3.1/config/elasticsearch.yml  
> > org.elasticsearch.bootstrap.Elasticsearch
> 
> $ tail -f /usr/local/var/log/elasticsearch/elasticsearch\_martins.log
> 
> > at  
> > org.elasticsearch.indices.cluster.IndicesClusterStateService.processMapping(IndicesClusterStateService.java:408)  
> > at  
> > org.elasticsearch.indices.cluster.IndicesClusterStateService.applyMappings(IndicesClusterStateService.java:362)  
> > at  
> > org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:181)  
> > at  
> > org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:444)  
> > at  
> > org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)  
> > 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:724)  
> > [2014-08-04 14:24:08,057][ERROR][rest.action.support] failed to  
> > send failure response  
> > java.lang.OutOfMemoryError: Java heap space
> 
> I have currently 337 MB RAM free. That should be enough, should it not?
> 
> _elasticsearch.yml_
> 
> > cluster.name: elasticsearch\_martins  
> > path.data: /usr/local/var/elasticsearch/  
> > path.logs: /usr/local/var/log/elasticsearch/  
> > path.plugins: /usr/local/var/lib/elasticsearch/plugins  
> > network.host: 127.0.0.1
> 
> Cheers,  
> Martin Stabenfeldt

--  
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/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 4, 2014, 2:17pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068/3 "2014-08-04T14:17:36Z")

</div>

You have 1g heap only configured for Elasticsearch. You should increase it.

Or try to disable bloom filter loading, this might help when recovering  
from large indices with unique terms. It will be disabled by default in ES  
1.4

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Jörg

On Mon, Aug 4, 2014 at 2:41 PM, Martin Stabenfeldt [martin@stabenfeldt.net](mailto:martin@stabenfeldt.net)  
wrote:

> Discovered that /usr/local/var/elasticsearch had grown to 14GB  
> As it's my develop machine, I did not need the old data and deleted it.
> 
> Started ES again and things went back to normal! 🙂
> 
> On Monday, August 4, 2014 2:34:49 PM UTC+2, Martin Stabenfeldt wrote:
> 
> > Hi,
> > 
> > This error arrived today after I rebooted my Mac.  
> > It might have been something that OS X has updated since last time, I  
> > don't know that for sure.  
> > I'm running "elasticsearch: stable 1.3.1, HEAD". Installed with Homebrew.
> > 
> > Any suggestions to how I can resolve this problem?
> > 
> > $ ps aux|grep java
> > 
> > > martins 13093 100.2 14.1 3810672 1179436 ?? R 2:10PM  
> > > 15:32.24 /usr/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true  
> > > -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> > > CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly  
> > > -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Xss200000  
> > > -Delasticsearch -Des.foreground=yes -Des.path.home=/usr/local/Cellar/elasticsearch/1.3.1  
> > > -cp :/usr/local/Cellar/elasticsearch/1.3.1/libexec/  
> > > elasticsearch-1.3.1.jar:/usr/local/Cellar/elasticsearch/1.  
> > > 3.1/libexec/_:/usr/local/Cellar/elasticsearch/1.3.1/libexec/sigar/_  
> > > -Des.config=/usr/local/Cellar/elasticsearch/1.3.1/config/elasticsearch.yml  
> > > org.elasticsearch.bootstrap.Elasticsearch
> > 
> > $ tail -f /usr/local/var/log/elasticsearch/elasticsearch\_martins.log
> > 
> > > at org.elasticsearch.indices.cluster.IndicesClusterStateService.  
> > > processMapping(IndicesClusterStateService.java:408)  
> > > at org.elasticsearch.indices.cluster.IndicesClusterStateService.  
> > > applyMappings(IndicesClusterStateService.java:362)  
> > > at org.elasticsearch.indices.cluster.IndicesClusterStateService.  
> > > clusterChanged(IndicesClusterStateService.java:181)  
> > > at org.elasticsearch.cluster.service.InternalClusterService$  
> > > UpdateTask.run(InternalClusterService.java:444)  
> > > at org.elasticsearch.common.util.concurrent.  
> > > PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(  
> > > PrioritizedEsThreadPoolExecutor.java:153)  
> > > 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:724)  
> > > [2014-08-04 14:24:08,057][ERROR][rest.action.support] failed to  
> > > send failure response  
> > > java.lang.OutOfMemoryError: Java heap space
> > 
> > I have currently 337 MB RAM free. That should be enough, should it not?
> > 
> > _elasticsearch.yml_
> > 
> > > cluster.name: elasticsearch\_martins  
> > > path.data: /usr/local/var/elasticsearch/  
> > > path.logs: /usr/local/var/log/elasticsearch/  
> > > path.plugins: /usr/local/var/lib/elasticsearch/plugins  
> > > network.host: 127.0.0.1
> > 
> > Cheers,  
> > Martin Stabenfeldt
> 
> --  
> 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/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/882b0734-8e80-4b01-9bff-720e248be838%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoHF09f9Pte0s%2BUCRKesTKanpVeNf6oS50-GgJM17tAciQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHF09f9Pte0s%2BUCRKesTKanpVeNf6oS50-GgJM17tAciQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:11am UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-still-337-mb-ram-available/19068/4 "2017-07-06T01:11:02Z")

</div>


