resourcelimit.c

Utility for CPU and memory and maximun forked processes limiting. Based on cpulimit.

For build:

gcc -o resourcelimit -lrt resourcelimit.c

Usage:

resourcelimit: [OPTIONS] -r EXE [EXE OPTIONS]
     OPTIONS:
       -c[value 0-100 * ncores]     : cpu limit value
       -m[memory limit value in Mb] : memory limit in megabytes
       -n[nproc limit value]        : NPROC limit value
       -r                           : limited process command

Get sources: http://git.bayrepo.net/bayrepo/plain/resourcelimit.c

Example

resourcelimit -c50 -m512 -n2000 -r progname --param1 --param2 --param3