LIMIT

Section: User Commands (1)
Updated: MiNT
Index Return to Main Contents
 

NAME

limit - run a program, restricting its resources  

SYNOPSIS

limit [ -m maxalloc ] [ -M maxmem ] [ -t maxtime ] program [ args... ]
limit -v  

DESCRIPTION

limit runs a subprogram with limited memory and time resources. maxalloc is the maximum amount of heap + malloc'd memory permitted to the program. maxmem is the maximum total amount of memory allotted to the program. If both allocation and total memory limits are in effect, a program is limited to the lesser of the two values. maxtime is the maximum amount of CPU time a process may consume; note that this is not the same as the real time the process has been executing, since processes that are waiting for input/output consume very little (if any) CPU time.

maxalloc and maxmem are numbers (optionally followed by "K" or "k"), denoting the memory size in bytes. maxtime has the form:

[[hh:]mm:]ss[.xxx]

giving the number of hours, minutes, seconds, and milliseconds permitted; the hours, minutes, and milliseconds are all optional.  

EXAMPLE

The following runs command foo with a maximum memory allocation of 102400 bytes, a total memory limit of 200512 bytes, and a CPU time limit of 12 minutes, 22.15 seconds.

limit -m 100K -M 200512 -t 12:22.15 foo
 

NOTES

If any of the limits are 0, then the corresponding limit is removed; otherwise, the default limits are whatever the limits were on the limit program itself. These may be printed with the -v flag.  

IMPLEMENTATION

Built with the MiNT library, patchlevel 19. Using a different library, or an earlier version of the MiNT library, may or may not cause problems; in particular, various constants defined in <signal.h> and <ioctl.h> will probably be wrong if you are not using the MiNT library.


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
NOTES
IMPLEMENTATION

This document was created by man2html, using the manual pages.
Time: 23:26:07 GMT, January 03, 2023