Messages in this thread | | | Date | Sun, 26 Sep 1999 04:01:53 +0200 (METDST) | From | German Jose Gomez Garcia <> | Subject | user resources limits? |
| |
Hello,
I'm not able to set user resource limits (with ulimit under bash or limit under tcsh), am I doing something wrong or does linux not support limitting maximun memory/filesize/descriptors/... in a per-user basis?
If not any user could make the system unusable using for example some kind of memory consumer program as the one attached.
- german
<>-------------------------------------+-----------------------------------<> One O.S. to rule them all, | German Gomez Garcia One O.S. to find them. | german@pinon.ccu.uniovi.es One O.S. to bring them all | and in the darkness bind them. | "Wur Qanar Wur Stilor Wur Kas" <>-------------------------------------+-----------------------------------<> #include <stdio.h> #include <stdlib.h>
main() { void *buf[2048]; long int mem = 0x3000000; int i = 0;
for(;;) { buf[i] = malloc(mem); if (buf[i] == NULL) mem /= 2; else { printf("%lX\n", mem); memset(buf[i], i, mem); i++; } if(mem < 1) { sleep(1); mem = 0x20000; } } return 0; }
| |