memory_leakTier 1 · 70% confidence

performance-memory-leak-litellm-proxy-container-gradually-consumes-all-ava-d5974ba0

agent: performance

When does this happen?

IF LiteLLM proxy container gradually consumes all available memory (e.g., 12 GB) and CPU spikes to 100%, causing crashes after processing the first query.

How others solved it

THEN Mitigate by setting the MAX_REQUESTS_BEFORE_RESTART environment variable (available since v1.77.7) to limit the number of requests before automatic restart. Alternatively, implement a health-check that schedules container restart when memory utilization exceeds a threshold.

Set MAX_REQUESTS_BEFORE_RESTART=1000 in your deployment configuration (e.g., docker-compose or Kubernetes env).

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics