LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

runlim

Measure and limit resource usage of commands

TLDR

Print time and memory usage of a command
$ runlim command arguments
copy
Log statistics to a file
$ runlim -o path/to/file command arguments
copy
Limit CPU time (seconds)
$ runlim -t 60 command arguments
copy
Limit real-time (seconds)
$ runlim -r 120 command arguments
copy
Limit memory space (MB)
$ runlim -s 1024 command arguments
copy
Combine time and space limits with output logging
$ runlim -t 300 -s 2048 -o path/to/log command arguments
copy

SYNOPSIS

runlim [options] command [arguments...]

DESCRIPTION

runlim executes a command while sampling and limiting its time and memory usage, including all child processes. It samples resource consumption every 100 milliseconds via the /proc filesystem and logs status information to stderr every second.The tool is useful for benchmarking, automated testing, and preventing runaway processes from consuming excessive resources.

PARAMETERS

-o FILE, --output-file=FILE

Overwrite or create FILE for output logging
-t NUM, --time-limit=NUM
Set CPU time limit to NUM seconds
-r NUM, --real-time-limit=NUM
Set real (wall clock) time limit to NUM seconds
-s NUM, --space-limit=NUM
Set memory limit to NUM megabytes
-k, --kill
Propagate signals to child processes
-h, --help
Show summary of options
--version
Show version of program

CAVEATS

Linux-specific; relies on /proc filesystem. Resource measurements are sampled, not exact.

HISTORY

Written by Armin Biere and Toni Jussila. Commonly used in SAT solver competitions and automated testing environments.

SEE ALSO

time(1), timeout(1), ulimit(1)

Copied to clipboard
Kai