From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,ca6cde4a4c600602 X-Google-Attributes: gid111c93,public From: Johannes Nix Subject: Re: stacksize limit Date: 2000/04/06 Message-ID: <8ci9cu$tbh@news.Informatik.Uni-Oldenburg.DE>#1/1 X-Deja-AN: 607585633 Sender: jnix@scheat References: <38E2098D.16320B4A@sljus.lu.se> Organization: Arbeitsgruppe Medizinische Physik Newsgroups: comp.os.linux.alpha Mikael Borg writes: > I am using some software that requires larger stack size > than the default (8Mb). To avoid running my calculations as > root, I figured I could raise the hard limit in > /etc/security/limits.conf. However, I am still not permitted > to set 'ulimit -s 32768' as user. Is there some service that > have to be kill -HUP'ed? Or is there some other way to > change the stack limit? > Many thanks for the hint. I run into the same problem last night, XEmacs crashed constantly when parsing a certain BibTeX file. I had to increase the stack size limit from 8 MB to 32MB, then it doesn't crashes any more. In the case of XEmacs it seems to be related that the regexp matcher uses alloca() to allocate memory on the stack, a similar error was corrected for DEC OSF/1. (But the cause is not confirmed yet). It seems to be necessary to edit /etc/security/limits.conf, and also remove possible limits imposed by the shell, as in /etc/profile . Then it works with local logins. The whole thing is not documented and nobody but the enligthed kernel hackers seem to know what all this limits do mean really. Perhaps some of them could give me a hint what: data seg size (kbytes) unlimited max memory size (kbytes) unlimited virtual memory (kbytes) unlimited pipe size (512 bytes) 8 does really mean. For example I got the impression that "max memory size" (aka RSS size) is ignored completely. Maybe that "virtual memory" is the sum of "data seg size" and "stack size", and that "max memory" is the physical memory which should be smaller than "virtual memory", and that "locked memory" cannot be more than "physical memory" - but who knows. At least if I start xemacs with 10kB of "max memory size" it runs happily and allocates 15 MB. With remote logins using ssh I need to edit the sshd startup script, that means in the SuSE case /etc/rc.d/sshd, and insert an ulimit -s 32000 then it works. I think it's because it is not a child of login() but started by an init script which is child from init. Maybe that only login reads the limits in limits.conf ? Also, batch jobs still are unaffected. It seems to be necessary to de-limit the atd startup script also if needed. There is also a file /etc/initscript, it has a manpage - be careful when creating it, if you make errors and don't have a root shell open you won't be able to log in again! As far as I understand, initscript is only able to set limits for console login processes, so there wouldn't be any advantages compared to editing limits.conf. Johannes