Skip to content

Commit 8bd2d30

Browse files
fix(restheart-mongo): bound JVM heap to prevent OOM on shared CI runners
RESTHeart 9.x's default JVM uses MaxRAMPercentage=25, which on a typical Woodpecker runner cgroup (~8GB) lands ~2GB heap. With the keploy/enterprise compat matrix running 3 restheart cells concurrent alongside parse-server / umami / doccano cells (12 lane-cells total on one runner), aggregate memory pressure triggers cgroup OOM and the kernel SIGKILLs lighter processes (bash, curl) mid-bootstrap. Observed in keploy/enterprise pipeline 3721/26 (record-stable-replay-pr): RESTHeart came up cleanly (`127.0.0.1:18070 is now reachable`), then `bash flow.sh bootstrap 240` got SIGKILL'd (exit 137) before any seed PUTs landed. Same shape across all 3 restheart cells in 3721. Cap heap at -Xmx512m (start at -Xms128m). Local single-cell record/replay peaks at ~280MB heap, so 512m is comfortable headroom without bleeding into neighbours. With the bound, each cell's footprint stays under ~700MB (heap + native + mongo); 3 restheart cells fit alongside other lanes on a shared runner. Validated locally: cell record-pr-replay-pr 296/0 PASSED with the new JAVA_TOOL_OPTIONS in place. RESTHeart logs confirm "Picked up JAVA_TOOL_OPTIONS: -Xms128m -Xmx512m ..." at startup.
1 parent 62cb46a commit 8bd2d30

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

restheart-mongo/docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ services:
2828
# the bearer signature verifiable across record→replay
2929
# container restarts (deterministic key, deterministic JWT).
3030
RHO: '/mclient/connection-string->"mongodb://${RESTHEART_MONGO_IP:-172.36.0.10}:27017";/http-listener/host->"0.0.0.0";/core/log-level->"INFO";/jwtConfigProvider/key->"keploy-fixed-jwt-secret-for-deterministic-recordings"'
31+
# Bound RESTHeart's JVM heap. RESTHeart 9.x's default uses
32+
# `MaxRAMPercentage=25` of cgroup memory, which on a typical
33+
# Woodpecker runner cgroup (~8GB) lands ~2GB heap. With three
34+
# restheart matrix cells running concurrent on the same
35+
# runner alongside parse-server / umami / doccano cells, the
36+
# total memory pressure triggers cgroup OOM and the kernel
37+
# SIGKILLs lighter processes (bash, curl) mid-bootstrap —
38+
# observed in keploy/enterprise pipeline 3721/26 (cell
39+
# record-stable-replay-pr) where `flow.sh bootstrap` got
40+
# killed (exit 137) right after RESTHeart came up. Capping
41+
# heap at 512m keeps each cell's footprint under ~700MB
42+
# (heap + native + mongo) so the runner can host all three
43+
# restheart cells plus the other lanes' cells in parallel.
44+
# 512m is comfortable for the record/replay workload (peak
45+
# observed at ~280MB in single-cell local runs).
46+
JAVA_TOOL_OPTIONS: "-Xms128m -Xmx512m"
3147
depends_on:
3248
mongo:
3349
condition: service_healthy

0 commit comments

Comments
 (0)