-
-
Save olimcc/ee70a6970367b241e100 to your computer and use it in GitHub Desktop.
Steps to reproduce an OOM for geospatial queries against elasticsearch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Start ES with the following settings: | |
# -Xms256m -Xmx1g -Xss256k | |
# 2. Create an index | |
curl -XPUT 'http://localhost:9200/test-index/' -d '{ | |
"settings": { | |
"index": { | |
"analysis.analyzer.default.type": "custom", | |
"analysis.analyzer.default.tokenizer": "keyword", | |
"analysis.analyzer.default.filter": ["lowercase"] | |
} | |
} | |
}' | |
# 3. Create a mapping | |
curl -XPUT 'http://localhost:9200/test-index/test-mapping/_mapping' -d'{ | |
"test-mapping": { | |
"properties": { | |
"geometry": { | |
"type": "geo_shape", | |
"tree": "quadtree", | |
"tree_levels": 16, | |
"distance_error_pct": 0.0 | |
} | |
} | |
} | |
}' | |
# 4. Perform a query | |
curl -XPOST 'http://localhost:9200/test-index/test-mapping/_search' -d'{ | |
"query": { | |
"constant_score": { | |
"boost": 1, | |
"filter": { | |
"geo_shape": { | |
"geometry": { | |
"verify": "within", | |
"shape": { | |
"type": "Envelope", | |
"coordinates": [ | |
[-87.06, 38.69], | |
[-80.78, 25.77] | |
] | |
}, | |
"relation": "intersects" | |
} | |
} | |
} | |
} | |
} | |
}' | |
# After some time.. | |
# java.lang.OutOfMemoryError: Java heap space | |
# Dumping heap to java_pid6585.hprof ... | |
# Exception in thread "elasticsearch[Carnivore][http_server_worker][T#1]" java.lang.OutOfMemoryError: Java heap space | |
# Exception in thread "elasticsearch[Carnivore][http_server_worker][T#1]" java.lang.OutOfMemoryError: Java heap space | |
# Exception in thread "elasticsearch[Carnivore][management][T#3]" java.lang.OutOfMemoryError: Java heap space | |
# at org.elasticsearch.index.merge.scheduler.ConcurrentMergeSchedulerProvider.stats(ConcurrentMergeSchedulerProvider.java:69) | |
# at org.elasticsearch.action.admin.indices.status.TransportIndicesStatusAction.shardOperation(TransportIndicesStatusAction.java:175) | |
# at org.elasticsearch.action.admin.indices.status.TransportIndicesStatusAction.shardOperation(TransportIndicesStatusAction.java:59) | |
# at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:234) | |
# at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:211) | |
# at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:187) | |
# at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) | |
# at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) | |
# at java.lang.Thread.run(Thread.java:662) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment