prod api: repeated Java heap OutOfMemoryError exits (often all replicas together)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, java, kubernetes
- Ambito
- backend, observability-sre
Direzione di ricerca
Start from the JVM flags in docker/build/service/entrypoint.sh (MaxRAMPercentage, HeapDumpOnOutOfMemoryError) and the deployment settings in vcell-fluxcd kustomize/base/api.yaml (memory limit, /dump emptyDir, imagePullPolicy). To identify the culprit request, add logging of request start or slow/large requests in the legacy Restlet /api/v0 path (LogService only logs completed requests), then copy the .hprof out of /dump after the next OOM. Done means either the offending request pattern is named with evidence, or a concrete config change (limit raise, IfNotPresent, restart-cron cleanup) is proposed and validated against Prometheus metrics; requires prod/Kubernetes access, so it is not startable from the issue text alone.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The prod api service (legacy Restlet /api/v0, the vcell-service image with arg api) repeatedly exits with Terminating due to java.lang.OutOfMemoryError: Java heap space. Several times, every replica failed within about 30 seconds of each other, which briefly takes down /api/v0 and trips the Better Stack health check.
This is separate from the 09-17/18 outage. That one came from an expired image pull secret: the OOM restarts couldn't pull the image. It was fixed by removing the pull secrets and making all images public, so restarts now recover in seconds. The OOMs themselves are unchanged.
Evidence (prod, 2026-09-16 → 09-25)
-
12 container restarts in 10 days, all
api. No other prod container restarted.- Kubernetes reports
reason=Error, exit code 3. That's-XX:+ExitOnOutOfMemoryError, not the kernel OOM killer, so the container never showsOOMKilled. - Every one of them is logged as
Terminating due to java.lang.OutOfMemoryError: Java heap space.
- Kubernetes reports
-
OOM times (UTC):
- 09-16 17:35, 09-17 04:37, 09-17 20:53;
- 09-18 22:14 (2 replicas);
- 09-19 10:01 (2);
- 09-20 22:49 (2);
- 09-21 09:39 (all 3).
None since 09-21. 8.1.8.04 went to prod on 09-25 with the same memory settings.
-
Memory is not leaking. Container working set swings between about 600 and 1,700 MiB (garbage collection) with no upward trend over pod lifetimes of up to 7 days (Prometheus, 10-day retention).
- Limit: 2000 Mi.
-XX:MaxRAMPercentage=50(docker/build/service/entrypoint.sh) gives a heap of about 1 GB.- Roughly 700 Mi is non-heap.
-
Pattern: replicas die close together, and the requests logged in the minutes before are ordinary (mostly
/api/v0/events,/biomodel/{id}/simulation/{id},/simtask). That points to a single heavy request (probably a large model) being retried on each replica in turn. -
The offending request is unknown. The Restlet access log (
LogService) is written when a request completes, so the one that ran out of memory never appears.
Possible actions
- Identify the request. Heap dumps go to
/dump(-XX:+HeapDumpOnOutOfMemoryError). In vcell-fluxcdkustomize/base/api.yaml,/dumpis anemptyDir(4Gi).- It survives OOM restarts (container restart, same pod) but is lost when a rollout replaces the pods. Today's 8.1.8.04 deploy discarded any earlier dumps.
- After the next OOM,
kubectl cpthe.hprofout before redeploying. - Caution: a dump contains secrets (DB password, JWT key), so it must not go on user-reachable storage (
/exportdir,/simdata). - Also consider logging request start (or slow/large requests), so the in-flight request is visible.
- More headroom. Raise the
apimemory limit in vcell-fluxcdkustomize/base/api.yaml, e.g. 2000 Mi → 3000 Mi (about a 1.5 GB heap at 50%). Nodes have 32 GB, and the busiest has about 80% committed as limits. RaisingMaxRAMPercentagealone would push the working set toward the limit. - Fix the root cause once the request is known, e.g. bound the work a single request can do (model size, math generation, result size).
- Restart resilience.
api.yamlsetsimagePullPolicy: "Always", so every restart re-pulls from GHCR. That's how the expired pull secret turned OOM restarts into an 18-hour outage. With immutable version tags,IfNotPresentwould make restarts independent of the registry. - Housekeeping. Delete the suspended hourly
restart-api-cron(vcell-fluxcdkustomize/overlays/prod/restart-api-cronjob.yamland itskustomization.yamlentry). It's suspended since 2026-08-22, memory isn't growing, and periodic restarts wouldn't prevent request-triggered OOMs anyway.
Related (observed while investigating)
/api/v0/simdata/{id}/jobindex/Nreturns a generic 500 when the simulation's results are missing or unreadable (bursts on 09-23 and 09-24). It should probably be a 404, like the BNGL fix in #2104.- Loki has no logs from any namespace for 09-21 18:00–21:00 UTC (a log-shipping outage).
🤖 Generated with Claude Code
- Lingua principale
- Java
- Stelle
- 140
- Fork
- 35
- Merge medio
- 11h 28m
- PR unite (30g)
- 19
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di virtualcell/vcell
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
virtualcell/vcell#2193 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
virtualcell/vcell#2138 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
virtualcell/vcell#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
virtualcell/vcell#2135 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
virtualcell/vcell#2134 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di virtualcell/vcell
Issue simili
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement Java macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
freerouting/freerouting#1079 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/maven-enforcer#1074 ·
I maintainer di solito rispondono entro 1 giorno
-
Gradle liquibaseDiffChangelog drops jhi_date_time_wrapperForse già presa @mraible l’ha presa oggi. Apertaarea: triage theme: undefined
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
jhipster/generator-jhipster#35998 ·
I maintainer di solito rispondono entro 1 giorno