# grpc::RESOURCE_EXHAUSTED: gRPC call failed with status code 8

- **ID:** `communication/grpc-resource-exhausted`
- **Domain:** communication
- **Category:** resource_error
- **Error Code:** `8`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

gRPC server or client exhausts memory, file descriptors, or concurrent stream limits, often due to stream leakage or insufficient resource quotas in the transport layer.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC 1.62 | active | — | — |
| gRPC-go v1.65 | active | — | — |
| gRPC-java 1.64 | active | — | — |
| envoy 1.30 | active | — | — |

## Workarounds

1. **Increase the gRPC server's maximum concurrent streams: set `GRPC_ARG_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 1000) and restart the server. Also monitor `grpc.server.streams` metric.** (85% success)
   ```
   Increase the gRPC server's maximum concurrent streams: set `GRPC_ARG_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 1000) and restart the server. Also monitor `grpc.server.streams` metric.
   ```
2. **Add client-side connection pooling: reuse gRPC channels and limit the number of concurrent calls per channel using a semaphore or rate limiter.** (80% success)
   ```
   Add client-side connection pooling: reuse gRPC channels and limit the number of concurrent calls per channel using a semaphore or rate limiter.
   ```
3. **Configure Envoy proxy to set `max_requests_per_connection` and `circuit_breakers` limits to prevent client-side resource exhaustion from overwhelming the gRPC server.** (88% success)
   ```
   Configure Envoy proxy to set `max_requests_per_connection` and `circuit_breakers` limits to prevent client-side resource exhaustion from overwhelming the gRPC server.
   ```

## Dead Ends

- **Increase server memory and restart** — The issue is often not raw memory but stream limit exhaustion (e.g., MAX_CONCURRENT_STREAMS). More memory doesn't increase stream quotas. (70% fail)
- **Set grpc.max_receive_message_size to a very high value (e.g., 500MB)** — This error is about connection-level resources, not message size. Changing message size doesn't address stream or FD exhaustion. (90% fail)
- **Disable keepalive pings in gRPC client** — Keepalive pings help detect dead connections and actually reduce resource leaks. Disabling them makes the problem worse. (80% fail)
