bash tasks are the OOM killer's first victims: score 1000, subagent runs 900, MemoryHigh on the bash daemon
This commit is contained in:
parent
d4dc8b48b1
commit
77f33a23d8
1 changed files with 155 additions and 32 deletions
|
|
@ -462,7 +462,9 @@ the file carries that drop-in's `MemoryMax=`.
|
|||
|
||||
At boot the container derives two values from a byte count:
|
||||
`BUN_JSC_forceRAMSize` (75%, claude-code's heap ceiling) and `MemoryHigh=` on
|
||||
`hive-subagent-daemon` (two thirds). Neither is in the agent's build, so a
|
||||
`hive-subagent-daemon` and on `hive-bash-daemon` (two thirds each; the bash
|
||||
daemon's covers every bash task, so a build storm throttles before the
|
||||
container's cap). Neither is in the agent's build, so a
|
||||
changed cap reaches them at the next container start without a rebuild.
|
||||
`infinity` sets neither. A missing or malformed file sets neither as well, and
|
||||
`hyperhive-memory-cap-check.service` logs a warning naming the path in the
|
||||
|
|
@ -477,8 +479,8 @@ rest of the drop-in, they reach a running agent at its next spawn or rebuild.
|
|||
|
||||
When the container reaches its cap, the kernel kills inside it, in this order:
|
||||
|
||||
1. a subagent run (`oom_score_adj` +1000);
|
||||
2. a bash task (0);
|
||||
1. a bash task (`oom_score_adj` +1000);
|
||||
2. a subagent run (+900);
|
||||
3. the harness and the agent's own `claude` (-500).
|
||||
|
||||
Each subagent run and each bash task has its own cgroup with
|
||||
|
|
@ -488,7 +490,7 @@ outside it. Inside the container these are
|
|||
and `/sys/fs/cgroup/system.slice/hive-bash-daemon.service/tasks/<id>/`; the
|
||||
daemon itself sits in `daemon/` beside them. A daemon that can't set these
|
||||
up logs one warning at start and runs everything in its own cgroup; subagent
|
||||
runs still get +1000.
|
||||
runs still get +900 and bash tasks +1000.
|
||||
|
||||
The container stays up through these kills. Each one counts in the
|
||||
`hyperhive.container.memory.oom_kills` metric, shown as "OOM kills by agent"
|
||||
|
|
|
|||
Loading…
Reference in a new issue