# Heap space - OutOfMemoryError while indexing shapes

**URL:** <https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384>\
**Category:** Elasticsearch\
**Created:** [June 6, 2017, 9:26am UTC](https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384 "2017-06-06T09:26:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdanielczyk](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tdanielczyk](https://discuss.elastic.co/u/tdanielczyk)\
**Post date:** [June 6, 2017, 9:26am UTC](https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384/1 "2017-06-06T09:26:49Z")

</div>

Hi.

While indexing shapes with high precision and no distance\_error\_pct elastic crashes on java.lang.OutOfMemoryError: Java heap space.

After crash elastic is not restarted, my configuration is default with heap space 4gb on machine with 8gb. Memory is locked (bootstrap.memory\_lock: true). There is single node in the cluster, default configuration of indices.

Is there any way how I can prevent from the crash withour automatic restart? Something like indexing request timeout? Any solution without precision and distance error change that will prevent from ES crash will be appreciated.

Elastic version:

"version" : {  
"number" : "5.4.1",  
"build\_hash" : "2cfe0df",  
"build\_date" : "2017-05-29T16:05:51.443Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.5.1"  
},

Mapping:

"mappings": {  
"bar": {  
"properties": {  
"shape": {  
"type": "geo\_shape",  
"tree": "quadtree",  
"precision": "50cm"  
}  
}  
}  
}

Indexed polygon:

"shape": {  
"type": "polygon",  
"coordinates" : [  
[  
[-66.118, 18.466], [-64.757, 32.321], [-80.19, 25.774], [-66.118, 18.466]  
]  
]  
}

Thanks!

---

<div class="post-metadata">

**Author:** ![ggbustos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ggbustos/32/18859_2.png) [@ggbustos](https://discuss.elastic.co/u/ggbustos)\
**Post date:** [June 7, 2017, 3:48am UTC](https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384/2 "2017-06-07T03:48:05Z")

</div>

Hi Tomek,

I am new on the community and also in the elastic stacks but am trying to help in some way, did you try by configuring the jvm.options in ES? probably you can try by increasing your current value e.g 4gb to 6gb?.

Let me know if you have any positive result.

Thanks,

Gustavo.-

---

<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:** [June 7, 2017, 9:55am UTC](https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384/3 "2017-06-07T09:55:48Z")

</div>

> [@tdanielczyk](#):
>
> Is there any way how I can prevent from the crash withour automatic restart?

Increase the resources for the node.

> [@tdanielczyk](#):
>
> "precision": "50cm"

Or reduce your precision, that is pretty high.

---

<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 5, 2017, 9:55am UTC](https://discuss.elastic.co/t/heap-space-outofmemoryerror-while-indexing-shapes/88384/4 "2017-07-05T09:55:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
