carlos / platform Public

Per-app memory limit: amadan.net's whole process tree is capped at the 512 MB exec cgroup Feature Request open

What I need

A supported way for an app to declare the memory its instances may use, for example carlos apps set --memory 2G, or a field in the app's config bundle, instead of every exec route getting the same fixed cgroup.

Why

amadan.net (account bah, app amadan-hub) runs as an exec route on the flagship box. The hub process and every per-repo child it spawns (amadan-hub repo …) live in one cgroup:

carlos.slice/carlos-edge.service/carlos-exec@amadan.net/g<gen>
memory.max   536870912   (512 MB)
memory.high  483180544
swap.max     536870912

The box has 7.8 GB and usually 3.5–4.5 GB available, but amadan can use at most 512 MB of it. Each resident repo process is ~18–25 MB idle, so the hub can hold about 16 repos. Its working set is 50+.

On 2026-10-20 we raised amadan's own repo cap (AMADAN_MAX_INSTANCES=64) to stop instance churn. About 7 hours later 55 resident repos filled the cgroup: memory.current 530 MB, swap full, memory.pressure some avg10=99.8 full=72. amadan.net stopped answering (the carlos-reach-amadan alarm, 07:45–07:55 UTC) while the box itself had plenty of free memory. We reverted the cap. amadan is separately cutting its own working set (CI wake notifications instead of polling), but the 512 MB ceiling stays the hard limit on how many repos the hub can serve.

We have not worked around this (e.g. by editing the cgroup on the box), because the limit is the platform's to own.

What would help

  1. A per-app memory setting (and ideally swap) that the activator applies to the exec cgroup, visible in carlos env/carlos apps output.
  2. A clear signal when an app is pinned at its limit: memory.events high was at 2.3M for amadan.net with nothing surfacing it. Something in carlos availability, or a log line when memory.high throttling is sustained, would have pointed at the cause in minutes.
  3. Docs stating the default (512 MB) so app authors can size their process trees against it.