Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Johannes Nix <Johannes.Nix@mail.uni-oldenburg.de>
Subject: Re: stacksize limit
Date: 2000/04/06	[thread overview]
Message-ID: <8ci9cu$tbh@news.Informatik.Uni-Oldenburg.DE> (raw)
In-Reply-To: 38E2098D.16320B4A@sljus.lu.se

Mikael Borg <mikael.borg@sljus.lu.se> 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



  reply	other threads:[~2000-04-06  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-29  5:00 stacksize limit Mikael Borg
2000-04-06  4:00 ` Johannes Nix [this message]
2000-04-06  4:00   ` Michal Jaegermann
2000-04-06  4:00     ` Johannes Nix
2000-04-07  4:00       ` Michal Jaegermann
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox