runlim
Measure and limit resource usage of commands
TLDR
Print time and memory usage of a command
$ runlim command arguments
Log statistics to a file$ runlim --output-file=path/to/file command arguments
Limit CPU time (seconds)$ runlim --time-limit=60 command arguments
Limit real-time (seconds)$ runlim --real-time-limit=120 command arguments
Limit memory space (MB)$ runlim --space-limit=1024 command arguments
SYNOPSIS
runlim [options] command [arguments...]
DESCRIPTION
runlim samples and limits time and memory usage of a program and its child processes. It uses the /proc filesystem on Linux to monitor resource consumption.
The tool is useful for benchmarking, testing, and preventing runaway processes from consuming excessive resources.
PARAMETERS
--output-file file
Log statistics to file instead of stdout--time-limit seconds
CPU time limit--real-time-limit seconds
Wall clock time limit--space-limit MB
Memory limit in megabytes
CAVEATS
Linux-specific; relies on /proc filesystem. Resource measurements are sampled, not exact.
HISTORY
Developed for benchmarking and resource limiting, commonly used in automated testing and competitive programming environments.
