On Thu, Apr 12, 2001, Ilya Konstantinov wrote about "Limiting memory with ulimit":
> Hi,
> 
> I currently have a hard data seg limit of 30,000K (ulimit -Hd) and I'm
> trying to run a perl-one liner:
> 
> perl -e 'for (0..1000000) { push @x,"1234567890"; }; print <>;'
> 
> which easily manages to allocate 46,352K VSZ and 44,448K RSS.
> 
> Could anyone please tell me what do I have to limit for the memory
> restriction to actually take place?

This is weird... I tried it, and indeed the ulimit -d seems to have no
effect! Is this a bug in Linux's handling of this limit? (I'm using kernel
2.2.16 and zsh 3.0.8).
Anyway, "ulimit -v" (limiting the amount of virtual memory the process)
seems to work fine:

$ ulimit -v 10000
$ perl -e 'for (0..1000000) { push @x,"1234567890"; }; print <>;'
Out of memory!


-- 
Nadav Har'El                        |     Thursday, Apr 12 2001, 19 Nisan 5761
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |How do you get holy water? Boil the hell
http://nadav.harel.org.il           |out of it.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to