opencode: hardcoded 4Gi memory limit causes OOMKilled / silent session deaths (manifest declares limitedMemory 24Gi)

Aperta
#3,395 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
helm, kubernetes, yaml

Direzione di ricerca

Start with opencode/templates/opencode.yaml and compare its hardcoded resource limits with the limitedMemory and limitedCpu values in OlaresManifest.yaml. Check how this app's chart exposes resource settings through values.yaml; done when the deployment's memory limit can accommodate the reported workload without repeated OOMKilled restarts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

The OpenCode app container ships with a hardcoded resources.limits.memory: 4Gi in opencode/templates/opencode.yaml, while the app's own OlaresManifest.yaml declares limitedMemory: 24Gi / limitedCpu: 13. On an Olares One (96 GB RAM) this 4 GiB cap is routinely exceeded by memory-heavy subprocesses that OpenCode legitimately runs inside its sessions (dev servers, vitest --max-old-space-size=8192, etc.), producing OOMKilled restarts that silently kill every active session.

Evidence (live diagnosis, 2026-08-08)

  • Pod opencode container: reason: OOMKilled, exitCode: 137 — 31 restarts in 23 h.
  • cgroup memory reached 4.26 GiB (over the 4 GiB limit) during a npx vitest --max-old-space-size=8192 run, ~40 s before the next OOM kill.
  • Every restart kills all in-flight sessions "silently"; reloading afterwards fails with envoy upstream connect error or disconnect/reset before headers ... Connection refused until the container is back up.
  • Hardcoded block in opencode/templates/opencode.yaml:
resources:
  limits:
    cpu: "4"
    memory: 4Gi
  requests:
    cpu: 200m
    memory: 1Gi

vs. the manifest:

requiredMemory: 2304Mi
limitedMemory: 24Gi
limitedCpu: 13

Suggested fix

  • Raise the hardcoded container memory limit (e.g. 8–12 GiB) to match the declared limitedMemory: 24Gi, and/or
  • Make the resource limits configurable via values.yaml / an env var instead of hardcoding them.

Workaround (applied successfully)

Patching the Deployment to limits.memory: 12Gi resolves the OOM loop (0 restarts after rollout).

Environment

  • Olares app: opencode 1.0.18 (image beclab/opencode:1.18.9.1), source market.olares
  • Olares One, 96 GB RAM / 24 cores, NVIDIA RTX 5090
Lingua principale
Go Template
Stelle
56
Fork
44
Merge medio
10h 39m
PR unite (30g)
211

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di beclab/apps

Tutte le issue di beclab/apps

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.