AWS OpenSearch Support
Fix OpenSearch high JVM memory pressure.
JVMMemoryPressure shows how full the Java heap is on data and master nodes. When it stays high, garbage collection stalls nodes, circuit breakers reject requests and the domain can become unresponsive. The cause is usually too many shards, heavy aggregations or oversized bulk requests.
When You Need This
The situations where this work pays for itself.
Signs it is time
- JVMMemoryPressure stays high or alarms fire repeatedly
- Requests fail with circuit_breaking_exception or 429 rejections
- Nodes drop out of the cluster during heavy queries
- Performance worsens as the number of indices grows
- You do not know if you need bigger nodes or fewer shards
What you get
- Diagnosis tying pressure to shards, queries or indexing
- Query, mapping and bulk request fixes
- Node sizing and dedicated master recommendations
- Alarms and an incident runbook
How we do it
A clear, safe process you can follow along with.
1. Look at the pattern
We chart JVMMemoryPressure per node alongside CPU, search and indexing rates, thread pool rejections and shard counts. Sustained high values differ from short spikes during a batch job.
2. Count shards per node
Every shard consumes heap. We compare shards per node and total index count against the instance size, because oversharding is the most common root cause.
3. Find heavy queries
We enable slow logs and look for large aggregations, deep pagination, wildcard-heavy queries and sorts or aggregations on text fields that load fielddata into heap.
4. Review indexing requests
Oversized bulk requests and many concurrent writers add memory pressure. We tune bulk size and concurrency and handle 429 responses with backoff.
5. Fix mappings and cache use
We use keyword or doc values for aggregation fields instead of fielddata on text, and check the field data and request cache sizes.
6. Scale or restructure
After reducing shards and fixing queries, if pressure remains we move to larger nodes, more data nodes, or dedicated master nodes so cluster coordination is not starved.
7. Alarm
We set CloudWatch alarms with thresholds from AWS guidance for JVMMemoryPressure and on rejections, with a runbook for response.
Mistakes we help you avoid
Common ways this goes wrong, and what we do instead.
Adding memory without reducing shards
Overhead from shards grows and the pressure returns.
Aggregating on analyzed text fields
They force fielddata into heap.
No dedicated master nodes on larger domains
Cluster state work competes with queries.
Frequently Asked Questions
What is a bad JVMMemoryPressure value on OpenSearch?
Sustained high readings are a warning, and AWS documents specific thresholds where action is needed. Check current guidance and alarm well before them.
What causes circuit_breaking_exception?
A request would use more memory than the breaker allows, often a large aggregation or fielddata load. Reduce the query size or fix the mapping.
Do bigger instances fix JVM memory pressure?
Sometimes, but if shards are too many or queries are too heavy, the pressure returns. Fix the structure first, then size.
Want Help With Fix OpenSearch high JVM memory pressure?
Schedule an appointment. Tell us about your environment and we will outline the safest, highest-value approach.
Schedule Appointment › No commitment required