Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site convexs
Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!convex!convexs!hosking
From: hosking@convexs.UUCP
Newsgroups: net.unix
Subject: Re: malloc(), virtual memory
Message-ID: <49600008@convexs>
Date: Tue, 17-Sep-85 02:21:00 EDT
Article-I.D.: convexs.49600008
Posted: Tue Sep 17 02:21:00 1985
Date-Received: Thu, 19-Sep-85 05:00:05 EDT
References: <203@cirl.UUCP>
Lines: 28
Nf-ID: #R:cirl.UUCP:-20300:convexs:49600008:000:1372
Nf-From: convexs.UUCP!hosking    Sep 17 01:21:00 1985


> Since as distributed 4.2 has a per-process VM limit of 6M, you cannot
> allocate more than 4M with malloc.   (Of course  if you  raise the VM
> nlimits you can get as much space as you like, provided  you have lots
> of paging space.)

It turns out to be  pretty trivial  to raise  this limit  if you have
source;  mostly  just  changing  a  few  parameters  in /sys/h/dmap.h
around:  DMMIN, DMMAX, DMTEXT, and NXDAD.   Unfortunately, the proper
values to change them to are not intuitively obvious, and will depend
upon subtle things like the size of your swap space, etc.  

Another  not  so obvious  problem with  this is  that if  your 200 MB
program  core dumps,  your disks  will fill  up in  a hurry!   We got
around this by not doing core dumps for programs  > 32  MB unless the
user had done the appropriate setrlimit call first.   This helps, but
still isn't a perfect solution.

Yet another problem is that it takes a LONG time to run  out of stack
space when running an infinitely recursive  program if  you allow 100
MB  of  stack!   We  kept the  default stack  limit of  1/2 MB, again
settable  via  setrlimit, and  only rarely  run into  cases where the
default's not enough.  Oddly enough, fsck was one of the things which
ran out of stack!
			Doug Hosking
			Convex Computer Corp.
			Richardson, TX
			{allegra, ihnp4,uiucdcs}!convex!convexs!hosking