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.

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.

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