Skip to content

Limit the memory of a dockerized test job - #317

Merged
sjoelund merged 1 commit into
masterfrom
claude/cgroup-memory-limit
Aug 17, 2026
Merged

Limit the memory of a dockerized test job#317
sjoelund merged 1 commit into
masterfrom
claude/cgroup-memory-limit

Conversation

@sjoelund

Copy link
Copy Markdown
Member

test.py caps the address space of one test at a time, so nothing bounds the sum of the tests it runs in parallel. That is worst for wasm-jit, whose tests are allowed 16 GB of address space each because the JIT reserves ~4 GB of it per wasm memory.

Cap the container the job runs in with docker run --memory=N --memory-swap=N, N = 85% of the node's RAM, since these jobs are pinned to the high-memory nodes. A cgroup limit charges memory in use rather than address space, covers every process test.py spawns, and on a breach the kernel kills the greediest omc - so a model can now fail because of a model tested in parallel with it, which the log makes visible: the limit is printed before the run and the peak plus the OOM kill count after it.

Only the targets that build their own image (wasm-jit today) get this; the jobs running directly on a node are unchanged.

test.py caps the address space of one test at a time, so nothing bounds
the sum of the tests it runs in parallel. That is worst for wasm-jit,
whose tests are allowed 16 GB of address space each because the JIT
reserves ~4 GB of it per wasm memory.

Cap the container the job runs in with `docker run --memory=N
--memory-swap=N`, N = 85% of the node's RAM, since these jobs are pinned
to the high-memory nodes. A cgroup limit charges memory in use rather
than address space, covers every process test.py spawns, and on a breach
the kernel kills the greediest omc - so a model can now fail because of
a model tested in parallel with it, which the log makes visible: the
limit is printed before the run and the peak plus the OOM kill count
after it.

Only the targets that build their own image (wasm-jit today) get this;
the jobs running directly on a node are unchanged.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sjoelund
sjoelund merged commit ed8e4cb into master Aug 17, 2026
5 checks passed
@sjoelund
sjoelund deleted the claude/cgroup-memory-limit branch August 17, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant