lkml.org 
[lkml]   [1999]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectuser 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;
}
\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.039 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site