# Java heap space error

**URL:** <https://discuss.elastic.co/t/java-heap-space-error/3288>\
**Category:** Elasticsearch\
**Created:** [September 1, 2010, 4:41pm UTC](https://discuss.elastic.co/t/java-heap-space-error/3288 "2010-09-01T16:41:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fucema](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fucema/32/3160_2.png) [@fucema](https://discuss.elastic.co/u/fucema)\
**Post date:** [September 1, 2010, 4:41pm UTC](https://discuss.elastic.co/t/java-heap-space-error/3288/1 "2010-09-01T16:41:15Z")

</div>

I've tried setting explicit JAVA\_OPTS memory settings but it doesn't help. Has anyone experienced memory errors upon starting a node?

[12:32:17,652][INFO][transport] [Stygyro] bound\_address {inet[/10.0.20.61:9300]}, publish\_address {inet[elasticd1/10.0.20.61:9300]}  
java.lang.OutOfMemoryError: Java heap space  
Dumping heap to /some/foo/bar/work/heap ...  
Heap dump file created [726407770 bytes in 12.177 secs]  
[12:32:35,517][WARN][transport.netty] [Stygyro] Exception caught on netty layer [[id: 0x4d480773, /10.0.10.11:57297 =\> /10.0.20.61:9300]]  
java.lang.OutOfMemoryError: Java heap space

Here is the config I use.

cluster:  
name: webs-elasticsearch

network:  
host: elasticd1

node:  
data: true

discovery:  
zen:  
ping:  
multicast:  
enabled: false  
unicast:  
hosts: [elasticd1, elasticd2, elasticd3, elasticd4, elasticd5]

http:  
enabled: true

jmx:  
createConnector: false

gateway:  
type: none

index:  
store:  
type: memory  
memory:  
cacheSize: 100m  
bufferSize: 100k

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [September 3, 2010, 10:46pm UTC](https://discuss.elastic.co/t/java-heap-space-error/3288/2 "2010-09-03T22:46:04Z")

</div>

On Wed, 2010-09-01 at 09:41 -0700, fucema wrote:

> I've tried setting explicit JAVA\_OPTS memory settings but it doesn't help.  
> Has anyone experienced memory errors upon starting a node?

If you're trying to store more data in memory than you have memory, you  
will have errors.

Why not just use the default file storage, and the kernel caches will  
ensure that the most frequently accessed data is already cached in  
memory?

clint

> [12:32:17,652][INFO][transport] [Stygyro] bound\_address  
> {inet[/10.0.20.61:9300]}, publish\_address {inet[elasticd1/10.0.20.61:9300]}  
> java.lang.OutOfMemoryError: Java heap space  
> Dumping heap to /some/foo/bar/work/heap ...  
> Heap dump file created [726407770 bytes in 12.177 secs]  
> [12:32:35,517][WARN][transport.netty] [Stygyro] Exception caught  
> on netty layer [[id: 0x4d480773, /10.0.10.11:57297 =\> /10.0.20.61:9300]]  
> java.lang.OutOfMemoryError: Java heap space
> 
> Here is the config I use.
> 
> cluster:  
> name: webs-elasticsearch
> 
> network:  
> host: elasticd1
> 
> node:  
> data: true
> 
> discovery:  
> zen:  
> ping:  
> multicast:  
> enabled: false  
> unicast:  
> hosts: [elasticd1, elasticd2, elasticd3, elasticd4,  
> elasticd5]
> 
> http:  
> enabled: true
> 
> jmx:  
> createConnector: false
> 
> gateway:  
> type: none
> 
> index:  
> store:  
> type: memory  
> memory:  
> cacheSize: 100m  
> bufferSize: 100k

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<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, 4:19am UTC](https://discuss.elastic.co/t/java-heap-space-error/3288/3 "2017-07-06T04:19:44Z")

</div>

Closed on July 6, 2017, 4:19am UTC


