[2.2.13] Are ulimits respected at all?!

Lord Praetor Satanus of Acheron (You-will-die-screaming@paypc.com)
Fri, 31 Dec 1999 20:50:22 +1000


$ ulimit -Ha
core file size (blocks) unlimited
data seg size (kbytes) 4096
file size (blocks) unlimited
max memory size (kbytes) 4096
stack size (kbytes) 2048
cpu time (seconds) unlimited
max user processes 256
pipe size (512 bytes) 8
open files 1024
virtual memory (kbytes) 6144

$ ulimit -Sa
core file size (blocks) unlimited
data seg size (kbytes) 4096
file size (blocks) unlimited
max memory size (kbytes) 4096
stack size (kbytes) 2048
cpu time (seconds) unlimited
max user processes 256
pipe size (512 bytes) 8
open files 1024
virtual memory (kbytes) 6144

Test code fragment:

myptr=calloc(0x00400000,4); /* allocate 16MB */
if (myptr)
{
printf("success!\n");
free(myptr);
}
else
{
printf("failure!\n");
}

GNU bash, version 1.14.7(1)

I ALWAYS get success! I know ulimit -c works, so does the max user process
limit. But memory doesn't seem to obey the ulimits, hard or soft.

Are ulimit controls on memory usage functional under Linux? How do I
enforce memory usage limits?

=R=

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/