Koriste se i getrlimit i setrlimit, za citanje trenutnih hard i soft limita odnosno za postavljanje istih. soft limiti su pod-limiti hard limita, znaci mogu da idu do velicine koja je ogranicena hard limitom, pritom proces moze da menja svoje soft limite kako god zeli u granicama hard limita dok hard limite moze samo da smanjuje a nikako i povecava, to moze da radi samo root. Evo deo iz "Design and Implementation of the 4.4 BSD Operating System" koji govori o tome sta sve moze da se limitira
Resource Limits
The kernel alse supports limiting of certain per-process resources. These resources include
- The maximum amount of CPU time that can be accumulated
- The maximum bytes that a process can request be locked into memory
- The maximum size of a file that can be created by a process
- The maximum size of a process`s data segment
- The maximum size of a process`s stack segment
- The maximum size of a core file that can be created by a process
- The maximum number of simultaneous processes allowed to a user
- The maximum number of simultaneous open files for a process
- The maximum amount of physical memory that a process may use at any given moment
#include <sys/resource.h>
int getrlimit(int resource, struct rlimit *rlp);
int setrlimit(int resource, const struct rlimit *rlp);
oni limiti koji tebe zanimaju su
RLIMIT_VMEM - za ogranicenje kolicine alocirane memorije
btw uradi na svojoj linux masini
ulimit -a i dobices nesto kao
core file size (blocks) 1000000
data seg size (kbytes) unlimited
file size (blocks) unlimited
max locked memory (kbytes) unlimited
max memory size (kbytes) unlimited
open files 1024
pipe size (512 bytes) 8
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 764
virtual memory (kbytes) unlimited
sa ulimit komadnom mozes da namestas svaki od ovih limita posebno
VMware VCP/Microsoft MCSE 2003/HP ASE