Resource Limits

Oxmgr monitors resource usage during daemon maintenance ticks. When limits are exceeded, the process is restarted. If the restart budget is exhausted, it's marked errored.

Configuration

oxfile.toml
[[apps]]
name = "api"
command = "node server.js"
max_memory_mb = 512
max_cpu_percent = 80.0
cgroup_enforce = true  # Linux only — hard limits via cgroup v2
deny_gpu = true        # best-effort GPU disable

Field Reference

FieldTypeDescription
max_memory_mbint?Memory limit in MB. Daemon polls RSS and restarts the process if exceeded.
max_cpu_percentfloat?CPU usage limit as a percentage. Triggers restart if exceeded.
cgroup_enforcebool?Linux only. Apply hard resource limits via cgroup v2 at spawn time. Requires kernel 5.2+ with cgroup v2 enabled.
deny_gpubool?Best-effort GPU disable. Sets common GPU-access env vars to disabled at spawn time.

How Limits Work

Soft limits (all platforms)

max_memory_mb and max_cpu_percent work via daemon polling — Oxmgr samples usage periodically and restarts the process when a limit is exceeded. This is available on Linux, macOS, and Windows.

Hard limits (Linux, cgroup v2)

cgroup_enforce = true places the process in a cgroup v2 slice with kernel-enforced memory limits. The kernel kills the process (OOM kill) if it exceeds the limit — no polling delay. Requires Linux kernel 5.2+ with cgroup v2 enabled.

Platform notes

  • cgroup_enforce requires Linux with cgroup v2 enabled. Check with: mount | grep cgroup2
  • deny_gpu is best-effort: disables common GPU env vars but doesn't prevent hardware access at kernel level.
  • Memory and CPU limits apply on all platforms via daemon polling.
  • If a process is OOM-killed by the kernel, it shows as an unexpected exit and triggers the normal restart policy.

Still have questions?

Open an issue or browse the source on GitHub.

Open an Issue ↗