Elasticsearch High JVM Memory Pressure and Out of Memory
Workaround available Self-hosted, Elastic Cloud Updated November 15, 2026Based on 2 user reportsHow we research
Quick answer
Sustained memory pressure above 85% slows searches and triggers circuit breakers or node crashes. The usual causes are too many shards, oversized heaps, swapping and heavy aggregations.
Most likely fix: Check the right metric
How to fix it
Try these in order — the most common fix is first.
1. Check the right metric
- Track old-generation usage as a rolling average, not instant heap percent
- Healthy GC: young under 50 ms about every 10 s, old under 1 s no more than once per 10 min
Did this fix it?2. Fix heap and OS settings
- Let Elasticsearch size the heap by default; if manual, Xms equals Xmx and at most half of RAM
- Disable swap on the OS
- Verify compressed OOPs are enabled
Did this fix it?3. Cut memory consumers
- Consolidate into fewer, larger shards
- Force merge or use an ILM force merge action after writes stop
- Lower index.max_result_window and search.max_buckets, set a default search timeout
Did this fix it?4. Scale if the workload outgrew the hardware
- Add node memory or nodes
- Enable AutoOps or stack monitoring alerts on JVM memory
Did this fix it?
Symptoms
Nodes go slow, long GC pauses in logs, nodes drop out of the cluster, circuit breaker errors, occasionally OutOfMemoryError.
Why it happens
- Too many shards or segments
- Swap enabled
- Heap set above about 30 GB, which disables compressed OOPs
- Heap larger than half of system RAM
- Expensive aggregations, large result windows or bulk requests
- Mapping explosion
This guide also covers
- elasticsearch high jvm memory pressure
- elasticsearch out of memory
- elasticsearch heap size too high
Still not working?
If Elasticsearch keeps failing, you're not alone. See every Elasticsearch problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All slow, laggy or resource-hungry guides →
Meilisearch Indexing Slow (Meilisearch)
Typesense Out of Memory (OOM) and RAM Sizing (Typesense)
Algolia Search Slow or High Latency (Algolia)
Other Elasticsearch errors
- Elasticsearch Cluster Health Yellow: Causes and Fixes
- Elasticsearch Cluster Health Red: How to Fix It
- Elasticsearch Unassigned Shards: Why and How to Fix
- Elasticsearch circuit_breaking_exception: Data Too Large
- Elasticsearch Disk Watermark: Index Read-Only (FORBIDDEN/12)
- Elasticsearch Limit of Total Fields [1000] Exceeded
- Why Is Elasticsearch So Slow? Fixing Slow Searches
- Elasticsearch Cannot Change Field Mapping: Reindex Guide