Heap space - OutOfMemoryError while indexing shapes


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"


"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]


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.



Increase the resources for the node.

Or reduce your precision, that is pretty high.

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