# ElasticsearchException: shard request cache eviction triggered memory pressure, current heap usage [85%]

- **ID:** `elasticsearch/shard-request-cache-eviction-memory-pressure`
- **Domain:** elasticsearch
- **Category:** resource_error
- **Error Code:** `ES_SHARD_CACHE_EVICTION_MEM`
- **Verification:** ai_generated
- **Fix Rate:** 83%

## Root Cause

The shard request cache grows too large under high query load, causing frequent evictions that increase heap pressure and degrade performance.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.17.0 | active | — | — |
| 8.11.0 | active | — | — |
| 8.12.0 | active | — | — |

## Workarounds

1. **Reduce cache size by setting `indices.requests.cache.size: 1%` in `elasticsearch.yml` to limit heap usage.** (80% success)
   ```
   Reduce cache size by setting `indices.requests.cache.size: 1%` in `elasticsearch.yml` to limit heap usage.
   ```
2. **Use explicit query caching with `?request_cache=true` only for queries that benefit from it, and set `index.requests.cache.enable: false` on indices with high write volume.** (85% success)
   ```
   Use explicit query caching with `?request_cache=true` only for queries that benefit from it, and set `index.requests.cache.enable: false` on indices with high write volume.
   ```
3. **Monitor cache eviction rates via `GET _nodes/stats/indices/request_cache` and optimize queries to reduce cache churn.** (90% success)
   ```
   Monitor cache eviction rates via `GET _nodes/stats/indices/request_cache` and optimize queries to reduce cache churn.
   ```

## Dead Ends

- **** — Larger heap delays evictions but doesn't solve the root cause of excessive caching; cache can grow unbounded and cause GC issues. (70% fail)
- **** — Disabling cache increases query latency for repeated queries, especially in dashboards or reporting scenarios. (65% fail)
