Skip to content

docker: size the heap to the container and exit on OOM in both editions (#8231) - #8311

Open
d-velev wants to merge 1 commit into
eclipse-dirigible:masterfrom
d-velev:issue-8231-docker-heap
Open

d-velev wants to merge 1 commit into
eclipse-dirigible:masterfrom
d-velev:issue-8231-docker-heap

Conversation

@d-velev

@d-velev d-velev commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The ENTRYPOINT set no heap sizing, so the JVM capped the heap at the container-aware default of 25% of the limit (256 MB on a 1 GiB container). The default edition exhausted that on the first publish (587 OutOfMemoryError lines), poisoned its file-backed H2 store, and - never OOM-killed (OOMKilled=false) - stayed Up answering 401 to every login (including /actuator/health and /services/core/version), so no restart policy fired. Both editions share this ENTRYPOINT; the Java edition only escaped because it is lighter.

Both Dockerfiles now launch with:

Verification: the JVM accepts both flags (java -XX:MaxRAMPercentage=50.0 -XX:+ExitOnOutOfMemoryError -version), and both ENTRYPOINT exec-form arrays remain valid JSON. The docker-build CI job builds both images. I did not build the images or measure heap behavior under a container memory limit locally (no Docker-with-memory-limit in this environment); the exact percentage may warrant tuning against a measured run on a 1 GiB and 768 MiB container.

Fixes #8231

🤖 Generated with Claude Code

…ns (eclipse-dirigible#8231)

The ENTRYPOINT set no heap sizing, so the JVM capped the heap at 25% of the container limit
(256 MB on a 1 GiB container). The default edition exhausted that on the first publish,
poisoned its file-backed H2 store, and - never OOM-killed - stayed Up answering 401 to every
login, so no restart policy fired.

Both Dockerfiles now launch with:
- -XX:MaxRAMPercentage=50.0 - doubles the heap ceiling to half the container limit. It is a
  ceiling, not a reservation, so RSS still only grows with actual heap use; 50% leaves headroom
  for the GraalVM-heavy default edition's off-heap footprint. Override from the launch for a
  differently sized container.
- -XX:+ExitOnOutOfMemoryError - the JVM exits on heap exhaustion instead of serving requests
  from a poisoned store, so an orchestrator restarts it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant