Skip to content

Repository files navigation

MemCordon

MemCordon runs a command and its descendants with optional workload-wide memory and elapsed-time limits. Use it when builds, tests, workers, or other commands can spawn child processes and need one containment boundary with reliable cleanup and exit-status reporting.

Sealed providers can additionally enforce an explicitly granted workload contract with --sealed --workload-contract contract.json. Admission checks the authenticated caller, exact grant and policy epoch before releasing the target; it does not add network authority to the provider's existing baseline. See the workload contract specification for registry administration, supported profiles, discovery, and qualification requirements.

MemCordon command containment overview

Install

Download the latest release for your platform and put memcordon (.exe) on PATH, or install with Cargo:

cargo install memcordon

Installation from source requires Rust 1.85 or newer.

Run a command

Apply a 1 GiB memory limit and a 10-minute deadline:

memcordon +1GiB +10m ./workload

./workload and any following arguments are passed through unchanged. MemCordon returns the direct command's exit status after required cleanup succeeds, unless a higher-precedence limit or supervision failure occurs.

Status Meaning
123 Deadline
124 Confirmed memory limit
125 Wrapper or cleanup failure

--restart can relaunch the workload after configured limits; its conditions and delays are configurable.

Platform support

Linux and Windows use cgroup v2 or Job Objects for hard memory enforcement when the host permits it. macOS uses sampled watchdog monitoring, which can overshoot or miss short bursts. memcordon doctor --json reports backend capabilities and host limitations without launching a workload.

On macOS the guardian owns the target and services its deadline independently of ordinary sampling. Setup counts toward the budget, with separate bounded cleanup and result-delivery reserves. Reports use schema 10 and distinguish confirmed execution from unknown authorization or incomplete cleanup; see the deadline contract.

Reference

  • Run memcordon --help or memcordon help for command-line reference.
  • See the contract reference for policies, platform behavior, reports, and exit codes.
  • Review the changelog or MIT license.

About

Cross-platform workload memory supervisor for macOS, Linux, and Windows, built in Rust.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages