LinuxCommandLibrary

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 --output-file=path/to/file command arguments
copy
Limit CPU time (seconds)
$ runlim --time-limit=60 command arguments
copy
Limit real-time (seconds)
$ runlim --real-time-limit=120 command arguments
copy
Limit memory space (MB)
$ runlim --space-limit=1024 command arguments
copy

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.

SEE ALSO

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community