Subject: Re: ulimit -m vs the real limit on process size?
To: David Maxwell <david@vex.net>
From: Douglas Troeger <dtroeger@ix.netcom.com>
List: port-i386
Date: 06/23/2002 10:53:57
Thanks very much -- ulimit -d does indeed do what I need, though the max
on my system seems to be 250316, which was the default max on ulimit -m.

I now have (still with the generic kernel)

----------------------------------------
bash-2.05$ ulimit -a
core file size (blocks)     unlimited
data seg size (kbytes)      250316
file size (blocks)          unlimited
max locked memory (kbytes)  83438
max memory size (kbytes)    250316
open files                  64
pipe size (512 bytes)       1
stack size (kbytes)         2048
cpu time (seconds)          unlimited
max user processes          80
virtual memory (kbytes)     252364
---------------------------------------


-- Doug




On Sun, 23 Jun 2002, David Maxwell wrote:

> On Fri, Jun 21, 2002 at 09:17:43PM -0400, Douglas Troeger wrote:
> >
> > I am running 1.5.2, with a generic kernel, on a machine with 256Meg of
> > ram.  Under bash, ulimit -m returns 250316 (kbytes).
> >
> > Nonetheless, my scheme processes are being killed by out-of-memory
> > errors at 128M, even though top reports that the system has memory
> > to spare.
> >
> > In fact, the following program
> >
> > --------------------------
> >
> > #include <stdio.h>
> >
> >  int main()
> >  {
> >     while (1) { malloc(4096); }
> >  }
> >
> > --------------------------
> >
> > allocates 128M (according to top), and no more.
> >
> >
> >
> > I would be most grateful if someone could explain this to me!  Can
> > the effective upper limit on process size be increased?
>
> You likely need to raise ulimit -d as well.
>
> The max for this will be 1G on a default kernel. If you need more, you
> can adjust /usr/src/sys/arch/i386/include/vmparam.h and compile a
> kernel.
>
> See the MAXxxxx defines in that file.
>
> --
> David Maxwell, david@vex.net|david@maxwell.net -->
> If you don't spend energy getting what you want,
> 	You'll have to spend it dealing with what you get.
> 					      - Unknown
>
>